From: Theodore Tso Date: Wed, 16 Jul 1997 02:16:18 +0000 (+0000) Subject: Only copy over the old table when there's an old table to copy over. X-Git-Tag: krb5-1.1-beta1~1106 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9c6c7b37daab8664516ec7a525e3105b3ea2114e;p=krb5.git Only copy over the old table when there's an old table to copy over. Otherwise, BoundsChecker complains about memcpy(foo, NULL, 0). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10118 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 4b8f21e86..5cd795478 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 15 22:15:09 1997 Theodore Y. Ts'o + + * serialize.c (krb5_register_serializer): Only copy over the old + table when there's an old table to copy over. Otherwise, + BoundsChecker complains about memcpy(foo, NULL, 0). + Tue Mar 25 00:32:55 1997 Theodore Y. Ts'o * preauth.c (obtain_sam_padata): Fix handling of the sam-timestamp diff --git a/src/lib/krb5/krb/serialize.c b/src/lib/krb5/krb/serialize.c index 084ecb677..58a88e4ed 100644 --- a/src/lib/krb5/krb/serialize.c +++ b/src/lib/krb5/krb/serialize.c @@ -70,8 +70,9 @@ krb5_register_serializer(kcontext, entry) if ((stable = (krb5_ser_handle) malloc(sizeof(krb5_ser_entry) * (kcontext->ser_ctx_count+1)))) { /* Copy in old table */ - memcpy(stable, kcontext->ser_ctx, - sizeof(krb5_ser_entry) * kcontext->ser_ctx_count); + if (kcontext->ser_ctx_count) + memcpy(stable, kcontext->ser_ctx, + sizeof(krb5_ser_entry) * kcontext->ser_ctx_count); /* Copy in new entry */ memcpy(&stable[kcontext->ser_ctx_count], entry, sizeof(krb5_ser_entry));