- strncat (typed_passwd, vcb->text->ptr, vcb->text->length);
- typed_passwd [vcb->endPos + vcb->text->length] = 0;
+ int L = vcb->text->length;
+ if (L >= sizeof(typed_passwd))
+ L = sizeof(typed_passwd)-1;
+ strncat (typed_passwd, vcb->text->ptr, L);
+ typed_passwd [vcb->endPos + L] = 0;