Only copy over the old table when there's an old table to copy over.
authorTheodore Tso <tytso@mit.edu>
Wed, 16 Jul 1997 02:16:18 +0000 (02:16 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 16 Jul 1997 02:16:18 +0000 (02:16 +0000)
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
src/lib/krb5/krb/serialize.c

index 4b8f21e8605ed92f23dc63f7c7d1b0cc59b8b7f8..5cd7954783fcbf79a7ee0c6a782f27eb46370679 100644 (file)
@@ -1,3 +1,9 @@
+Tue Jul 15 22:15:09 1997  Theodore Y. Ts'o  <tytso@mit.edu>
+
+       * 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  <tytso@mit.edu>
 
        * preauth.c (obtain_sam_padata): Fix handling of the sam-timestamp
index 084ecb677c3cee7307cbfb43bae1501c4345befc..58a88e4ed7feeb8fc5dbbb897b5b250238eee62a 100644 (file)
@@ -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));