diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-10-23 00:02:26 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-10-23 00:02:26 +0000 |
commit | 306e4cbead22e2bb12f699d0072eb8d5b1bc6733 (patch) | |
tree | 1a2fa814bb40104a2656b76ae23f02c8641c36d0 | |
parent | 9b323a3c0deb73cea3c39e5b7323bdf17e199c5c (diff) | |
download | samba-306e4cbead22e2bb12f699d0072eb8d5b1bc6733.tar.gz samba-306e4cbead22e2bb12f699d0072eb8d5b1bc6733.tar.bz2 samba-306e4cbead22e2bb12f699d0072eb8d5b1bc6733.zip |
fixed a possible segv when dealing with a blank password
(This used to be commit d5d0d0de50482ed16c594b1cc4cc113e2526a915)
-rw-r--r-- | source3/libads/kerberos.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index b586d84226..bef2febaef 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -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; } |