diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-03-12 17:54:57 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-03-12 17:55:30 +0200 |
commit | 9d9f34d1ef0483fc012ea283e649d507ff410638 (patch) | |
tree | 734844c924f9b395368ddcd9e4f08e1fc6e7abaa | |
parent | 06bf9bbf7922322d770a032aa9c8f9d3725984bd (diff) | |
download | vmod-variable-9d9f34d1ef0483fc012ea283e649d507ff410638.tar.gz vmod-variable-9d9f34d1ef0483fc012ea283e649d507ff410638.tar.bz2 |
Fix NULL dereferencing.
The bug was triggered by invoking symtab_remove with the name that has
not yet been entered into the symtab. Reported by Julian Sternberg.
* src/variable.c (symtab_remove): Return ENOENT if no matching entry
was found.
-rw-r--r-- | src/variable.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/variable.c b/src/variable.c index 333daeb..8e75ea2 100644 --- a/src/variable.c +++ b/src/variable.c | |||
@@ -172,6 +172,9 @@ symtab_remove(struct symtab *st, const char *name) | |||
172 | if (i == pos) | 172 | if (i == pos) |
173 | return ENOENT; | 173 | return ENOENT; |
174 | } | 174 | } |
175 | |||
176 | if (!entry) | ||
177 | return ENOENT; | ||
175 | 178 | ||
176 | var_free(entry); | 179 | var_free(entry); |
177 | 180 | ||