aboutsummaryrefslogtreecommitdiff
path: root/src/lookup.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-11-14 18:24:48 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-11-14 18:24:48 +0200
commit83a06bbc6b3796a0b8646816da34c6672488cbf0 (patch)
tree286feb9e64e6171196bd46a75acb8d97034fd721 /src/lookup.c
parent776f6ebe0a330c3a5c0ba541c291ee7ffbbd5151 (diff)
downloadgrecs-83a06bbc6b3796a0b8646816da34c6672488cbf0.tar.gz
grecs-83a06bbc6b3796a0b8646816da34c6672488cbf0.tar.bz2
Fix coredump when searching in an empty tree.
Diffstat (limited to 'src/lookup.c')
-rw-r--r--src/lookup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lookup.c b/src/lookup.c
index e92363f..1785457 100644
--- a/src/lookup.c
+++ b/src/lookup.c
@@ -562,6 +562,8 @@ grecs_match_buf_first(struct grecs_match_buf *buf, struct grecs_node *tree)
buf->argi = 0;
buf->root = tree;
buf->node = grecs_tree_first_node(tree);
+ if (!buf->node)
+ return NULL;
if (grecs_match(buf))
node = buf->node;
else

Return to:

Send suggestions and report system problems to the System administrator.