summaryrefslogtreecommitdiffstats
path: root/patches/ppp-2.4.4/ppp-2.4.4-protect-update_db_entry.diff
blob: 352488f95c26cfa0c241a299b4be71639fa95c7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From: Martin.Lottermoser@t-online.de
Subject: Bug#308136: Debian bug 308136 (SEGV in pppd)

The function update_db_entry() may only be called if pppdb is not NULL;
unfortunately in this situation it is. Other calls to update_db_entry()
are protected against this, see, e.g., the end of script_setenv().

---
 pppd/main.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Index: pppd/main.c
===================================================================
--- pppd/main.c.orig
+++ pppd/main.c
@@ -1939,9 +1939,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;
 	    }