summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org.ua>2016-03-12 15:58:44 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2016-03-12 15:58:44 (GMT)
commit6669c8843b3cad84d4de63584b2675bc1b1c8ef5 (patch) (side-by-side diff)
tree2160654492eed8ffdcf41981d6c5b184424dfe12 /src
parent2dbad2727f1d00b223353965b326cfffa96fc776 (diff)
downloadgrecs-6669c8843b3cad84d4de63584b2675bc1b1c8ef5.tar.gz
grecs-6669c8843b3cad84d4de63584b2675bc1b1c8ef5.tar.bz2
Prevent NULL dereferencing when attempting to remove an unexistent symtab entry.
* src/symtab.c (grecs_symtab_remove): Return if no matching entry was found.
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/symtab.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/symtab.c b/src/symtab.c
index 652f859..d3fdf1d 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -228,6 +228,9 @@ grecs_symtab_remove(struct grecs_symtab *st, void *elt)
return ENOENT;
}
+ if (!entry)
+ return ENOENT;
+
syment_free(st, entry);
for (;;) {

Return to:

Send suggestions and report system problems to the System administrator.