From: Ken Raeburn Date: Mon, 30 Jun 2008 22:07:06 +0000 (+0000) Subject: memcpy(NULL, ptr, 0) is invalid, so don't do it X-Git-Tag: krb5-1.7-alpha1~618 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0126535ae92418c8116c9f1a27b26d0e9047eab8;p=krb5.git memcpy(NULL, ptr, 0) is invalid, so don't do it git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20492 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/changepw.c b/src/lib/krb5/os/changepw.c index 275f61a63..1de5a217a 100644 --- a/src/lib/krb5/os/changepw.c +++ b/src/lib/krb5/os/changepw.c @@ -143,7 +143,8 @@ static int kpasswd_sendto_msg_callback(struct conn_state *conn, void *callback_c krb5_free_addresses(ctx->context, addrs); goto cleanup; } - memcpy(local_kaddr.contents, addrs[0]->contents, addrs[0]->length); + if (addrs[0]->length) + memcpy(local_kaddr.contents, addrs[0]->contents, addrs[0]->length); krb5_free_addresses(ctx->context, addrs); }