Skip Menu |

Subject: git commit

Avoid passing null for asprintf strings

It is undefined behavior to pass null to a printf function for a %.*s
substitution, even if the accompanying length is zero. OpenBSD
generates syslog warnings from libc when it sees a null pointer in a
string substitution (reported by Nathanael Rensen).
krb5_sname_to_principal() passes a null pointer in the usual case
where there is no port trailer. Address this case and others where we
use asprintf() with %.*s substitutions and might pass null, either by
avoiding the use of asprintf() or by ensuring that the pointer isn't
Author: Greg Hudson <>
Commit: b6a29fec8e9f283aec0b82ca22328014725d0d7f
Branch: master
src/kadmin/server/server_stubs.c | 6 +++-
src/lib/krb5/krb/get_in_tkt.c | 5 +--
src/lib/krb5/krb/preauth_otp.c | 41 +++++++++++++++++--------------------
src/lib/krb5/os/sn2princ.c | 2 +-
4 files changed, 26 insertions(+), 28 deletions(-)