This commit is contained in:
Arun Prakash Jana 2020-02-28 19:30:50 +05:30
parent 88167511f6
commit d1fcc5351e
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -2921,6 +2921,10 @@ static bool parsekvpair(kv **arr, char **envcpy, const uchar id, ushort *items)
kvarr = *arr; kvarr = *arr;
*envcpy = strdup(ptr); *envcpy = strdup(ptr);
if (!*envcpy) {
xerror();
return FALSE;
}
ptr = *envcpy; ptr = *envcpy;
nextkey = ptr; nextkey = ptr;
@ -2948,7 +2952,7 @@ static bool parsekvpair(kv **arr, char **envcpy, const uchar id, ushort *items)
} }
if (i < maxitems) { if (i < maxitems) {
if (*kvarr[i - 1].val == '\0') if (kvarr[i - 1].val && *kvarr[i - 1].val == '\0')
return FALSE; return FALSE;
kvarr[i].key = '\0'; kvarr[i].key = '\0';
} }