summaryrefslogtreecommitdiff
path: root/src/basic/strbuf.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2016-02-19 12:23:43 +0100
committerDaniel Mack <github@zonque.org>2016-02-19 12:23:43 +0100
commitdfec18925e3ca4d850e01dcf65499fca47cb0589 (patch)
tree4c690e12456e0c1a3c7171aa62314b5328b1467d /src/basic/strbuf.c
parent22b73e9cd79e6a6580e72cd269098e45a7971086 (diff)
parent240a7ba9d8eaf76e1f3fb7a5b8424ab6eaead59d (diff)
Merge pull request #2660 from keszybz/memleaks-and-ubsan
Memleaks and ubsan
Diffstat (limited to 'src/basic/strbuf.c')
-rw-r--r--src/basic/strbuf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c
index 77220c0251..dac2881603 100644
--- a/src/basic/strbuf.c
+++ b/src/basic/strbuf.c
@@ -156,6 +156,10 @@ ssize_t strbuf_add_string(struct strbuf *str, const char *s, size_t len) {
return off;
}
+ /* bsearch is not allowed on a NULL sequence */
+ if (node->children_count == 0)
+ break;
+
/* lookup child node */
c = s[len - 1 - depth];
search.c = c;