memcpy(NULL, ptr, 0) is invalid, so don't do it
authorKen Raeburn <raeburn@mit.edu>
Mon, 30 Jun 2008 22:07:06 +0000 (22:07 +0000)
committerKen Raeburn <raeburn@mit.edu>
Mon, 30 Jun 2008 22:07:06 +0000 (22:07 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20492 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/changepw.c

index 275f61a63bc222f0433cd8e1391845a034bb14df..1de5a217ab29e9c867737bd369690317872b3584 100644 (file)
@@ -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);
     }