]> git.ipfire.org Git - thirdparty/krb5.git/commit
Avoid undefined memcpy/memmove invocations master 1503/head
authorGreg Hudson <ghudson@mit.edu>
Fri, 3 Apr 2026 23:33:50 +0000 (19:33 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 9 Apr 2026 04:51:07 +0000 (00:51 -0400)
commita2d2e2849ea0968ef81e74983f0ec4a0258d9eee
treed7ec73a7aeebd5a3cfe59ddc9da5bdea5875bca4
parentc2697c127be660cfe2a623e153c347ade50f184b
Avoid undefined memcpy/memmove invocations

Where memcpy() or memmove() might be invoked with null input or output
pointers, add checks for non-zero length.  For brevity, add helpers
k5memcpy() and k5memmove() and use them in files that include
k5-int.h.

Most of the potential undefined invocations were reported by Evgeny
Shemyakin.
15 files changed:
src/include/k5-int.h
src/kadmin/server/ipropd_svc.c
src/kdc/fast_util.c
src/kdc/rtest.c
src/lib/crypto/builtin/kdf.c
src/lib/crypto/krb/aead.c
src/lib/crypto/krb/cf2.c
src/lib/gssapi/krb5/prf.c
src/lib/krb5/asn.1/asn1_encode.c
src/lib/krb5/krb/serialize.c
src/lib/rpc/xdr_mem.c
src/plugins/kdb/db2/libdb2/btree/btree.h
src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c
src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c
src/util/support/hashtab.c