diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-11-14 18:24:48 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-11-14 18:24:48 +0200 |
commit | 83a06bbc6b3796a0b8646816da34c6672488cbf0 (patch) | |
tree | 286feb9e64e6171196bd46a75acb8d97034fd721 /src/lookup.c | |
parent | 776f6ebe0a330c3a5c0ba541c291ee7ffbbd5151 (diff) | |
download | grecs-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.c | 2 |
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 |