1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

fixed a possible segv when dealing with a blank password

(This used to be commit d5d0d0de50)
This commit is contained in:
Andrew Tridgell 2002-10-23 00:02:26 +00:00
parent 9b323a3c0d
commit 306e4cbead

View File

@ -40,8 +40,12 @@ kerb_prompter(krb5_context ctx, void *data,
memset(prompts[0].reply->data, 0, prompts[0].reply->length);
if (prompts[0].reply->length > 0) {
strncpy(prompts[0].reply->data, data, prompts[0].reply->length-1);
prompts[0].reply->length = strlen(prompts[0].reply->data);
if (data) {
strncpy(prompts[0].reply->data, data, prompts[0].reply->length-1);
prompts[0].reply->length = strlen(prompts[0].reply->data);
} else {
prompts[0].reply->length = 0;
}
}
return 0;
}