From: Martin.Lottermoser@t-online.de Date: Sun, 9 Jun 2013 12:04:25 +0000 (+1000) Subject: pppd: Fix segfault in update_db_entry() X-Git-Tag: ppp-2.4.7~19 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=37476164f15a45015310b9d4b197c2d7db1f7f8f;hp=52cd43a84bea524033b918b603698104f221bbb7 pppd: Fix segfault in update_db_entry() The function update_db_entry() may only be called if pppdb is not NULL; unfortunately in one situation it is. Other calls to update_db_entry() are protected against this, see, e.g., the end of script_setenv(). This is from the Debian pppd patches, and fixes Debian bug 308136 (SEGV in pppd). Signed-off-by: Paul Mackerras --- diff --git a/pppd/main.c b/pppd/main.c index 6e7378b..6d50d1b 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -2043,9 +2043,11 @@ script_setenv(var, value, iskey) free(p-1); script_env[i] = newstring; #ifdef USE_TDB - if (iskey && pppdb != NULL) - add_db_key(newstring); - update_db_entry(); + if (pppdb != NULL) { + if (iskey) + add_db_key(newstring); + update_db_entry(); + } #endif return; }