From 9c6c7b37daab8664516ec7a525e3105b3ea2114e Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 16 Jul 1997 02:16:18 +0000 Subject: [PATCH] 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 --- src/lib/krb5/krb/ChangeLog | 6 ++++++ src/lib/krb5/krb/serialize.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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)); -- 2.26.2