[krbdev.mit.edu #9047] git commit

Greg Hudson via RT rt-comment at krbdev.mit.edu
Thu Jan 27 21:11:01 EST 2022


Thu Jan 27 21:11:01 2022: Request 9047 was acted upon.
 Transaction: Ticket created by ghudson at mit.edu
       Queue: krb5
     Subject: git commit
       Owner: ghudson at mit.edu
  Requestors: 
      Status: new
 Ticket <URL: https://krbdev.mit.edu/rt/Ticket/Display.html?id=9047 >



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
null.

https://github.com/krb5/krb5/commit/b6a29fec8e9f283aec0b82ca22328014725d0d7f
Author: Greg Hudson <ghudson at mit.edu>
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(-)



More information about the krb5-bugs mailing list