Don't crash when encounter unexpected XML input

This commit is contained in:
topjohnwu 2019-03-12 17:19:19 -04:00
parent 4395ffec5f
commit f2f4649ab0

View File

@ -106,6 +106,8 @@ static bool parse_packages_xml(string_view s) {
string_view pkg;
for (char *tok = start; *tok;) {
char *eql = strchr(tok, '=');
if (eql == nullptr)
break;
*eql = '\0'; /* Terminate '=' */
string_view key(tok, eql - tok);
eql += 2; /* Skip '="' */