From c31b03327f4ee4307ce97db5bfddb592c5d83fe3 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Tue, 15 Apr 2014 22:50:53 +0200 Subject: [PATCH] PPP, from PPPD upstream, Don't crash if NULL pointer passed to vslprintf for %q or %v 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 --- src/netif/ppp/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/netif/ppp/utils.c b/src/netif/ppp/utils.c index c49c179f..d03f6c25 100644 --- a/src/netif/ppp/utils.c +++ b/src/netif/ppp/utils.c @@ -283,6 +283,8 @@ int ppp_vslprintf(char *buf, int buflen, char *fmt, va_list 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 {