From 0126535ae92418c8116c9f1a27b26d0e9047eab8 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 30 Jun 2008 22:07:06 +0000 Subject: [PATCH] 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 --- src/lib/krb5/os/changepw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.26.2