From: Ken Raeburn Date: Sat, 17 Jan 2009 01:00:22 +0000 (+0000) Subject: If buffer length is 0, force pointer to NULL, to keep valgrind happier when callers... X-Git-Tag: krb5-1.7-alpha1~62 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=883d013266c6a3955fe692dc8d7d38dbef5c957f;p=krb5.git If buffer length is 0, force pointer to NULL, to keep valgrind happier when callers don't bother git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21762 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/write_msg.c b/src/lib/krb5/os/write_msg.c index 7586c9b86..e6001e8c6 100644 --- a/src/lib/krb5/os/write_msg.c +++ b/src/lib/krb5/os/write_msg.c @@ -52,11 +52,13 @@ krb5int_write_messages(krb5_context context, krb5_pointer fdp, krb5_data *outbuf nbufs1 = 1; len[0] = htonl(outbuf[0].length); SG_SET(&sg[0], &len[0], 4); - SG_SET(&sg[1], outbuf[0].data, outbuf[0].length); + SG_SET(&sg[1], outbuf[0].length ? outbuf[0].data : NULL, + outbuf[0].length); if (nbufs1 == 2) { len[1] = htonl(outbuf[1].length); SG_SET(&sg[2], &len[1], 4); - SG_SET(&sg[3], outbuf[1].data, outbuf[1].length); + SG_SET(&sg[3], outbuf[1].length ? outbuf[1].data : NULL, + outbuf[1].length); } if (krb5int_net_writev(context, fd, sg, nbufs1 * 2) < 0) { return errno;