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:
parent
48ddca5f35
commit
82501b3fc4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user