mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-23 14:46:01 +00:00
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
This commit is contained in:
parent
f6d56e2937
commit
c31b03327f
|
@ -283,6 +283,8 @@ int ppp_vslprintf(char *buf, int buflen, char *fmt, va_list args) {
|
||||||
case 'q': /* quoted string */
|
case 'q': /* quoted string */
|
||||||
quoted = c == 'q';
|
quoted = c == 'q';
|
||||||
p = va_arg(args, unsigned char *);
|
p = va_arg(args, unsigned char *);
|
||||||
|
if (p == NULL)
|
||||||
|
p = (unsigned char *)"<NULL>";
|
||||||
if (fillch == '0' && prec >= 0) {
|
if (fillch == '0' && prec >= 0) {
|
||||||
n = prec;
|
n = prec;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user