From: Paul Mackerras Date: Thu, 2 Jan 2014 04:00:12 +0000 (+1100) Subject: pppd: Don't crash if NULL pointer passed to vslprintf for %q or %v X-Git-Tag: ppp-2.4.7~14 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;ds=sidebyside;h=906814431bddeb2061825fa1ebad1a967b6d87a9;p=ppp.git pppd: Don't crash if NULL pointer passed to vslprintf for %q or %v This is to avoid crashes like that reported in https://bugs.launchpad.net/ubuntu/+source/ppp/+bug/1244714 Signed-off-by: Paul Mackerras --- diff --git a/pppd/utils.c b/pppd/utils.c index 6cf80fe..29bf970 100644 --- a/pppd/utils.c +++ b/pppd/utils.c @@ -296,6 +296,8 @@ vslprintf(buf, buflen, fmt, args) case 'q': /* quoted string */ quoted = c == 'q'; p = va_arg(args, unsigned char *); + if (p == NULL) + p = (unsigned char *)""; if (fillch == '0' && prec >= 0) { n = prec; } else {