1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 19:21:53 +03:00

basic/strbuf: do not call bsearch with a null argument

Das ist verboten!

src/basic/strbuf.c:162:23: runtime error: null pointer passed as argument 2,
                           which is declared to never be null
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-02-18 17:33:10 -05:00
parent 48ddca5f35
commit 82501b3fc4

View File

@ -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;