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>
return NULL;
for (p = buf; len > 0; s++, len--) {
return NULL;
for (p = buf; len > 0; s++, len--) {
const unsigned char *s = (unsigned char *)src;
static unsigned char buf[32];
const unsigned char *s = (unsigned char *)src;
static unsigned char buf[32];
+ if (!src) {
+ *len = 0;
+ return NULL;
+ }
+
while (isspace(*src))
src++;
while (isspace(*src))
src++;