diff options
author | Daniel Mack <github@zonque.org> | 2016-02-19 12:23:43 +0100 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2016-02-19 12:23:43 +0100 |
commit | dfec18925e3ca4d850e01dcf65499fca47cb0589 (patch) | |
tree | 4c690e12456e0c1a3c7171aa62314b5328b1467d /src/basic/strbuf.c | |
parent | 22b73e9cd79e6a6580e72cd269098e45a7971086 (diff) | |
parent | 240a7ba9d8eaf76e1f3fb7a5b8424ab6eaead59d (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.c | 4 |
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; |