Don't call memset with a zero length
authorKen Raeburn <raeburn@mit.edu>
Wed, 12 Jan 2011 22:00:40 +0000 (22:00 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 12 Jan 2011 22:00:40 +0000 (22:00 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24594 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/krb5/k5sealv3.c

index 0e9b359755a98d0f2a7e43c5479cca239919fdcc..1613913a76bba0368a318b239c850bd246e8c877 100644 (file)
@@ -159,7 +159,8 @@ gss_krb5int_make_seal_token_v3 (krb5_context context,
         store_64_be(ctx->seq_send, outbuf+8);
 
         memcpy(plain.data, message->value, message->length);
-        memset(plain.data + message->length, 'x', ec);
+        if (ec != 0)
+            memset(plain.data + message->length, 'x', ec);
         memcpy(plain.data + message->length + ec, outbuf, 16);
 
         cipher.ciphertext.data = (char *)outbuf + 16;