Those functions may be called with a NULL source pointer, especially during
pkg_merge(), so allow that to keep call sites simple.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
'c', 'd', 'e', 'f'
};
- if (len > 32)
+ if (!s || len > 32)
return NULL;
for (p = buf; len > 0; s++, len--) {
const unsigned char *s = (unsigned char *)src;
static unsigned char buf[32];
+ if (!src) {
+ *len = 0;
+ return NULL;
+ }
+
while (isspace(*src))
src++;