Skip to content

Commit

Permalink
Correct closing of NODE_ITEM
Browse files Browse the repository at this point in the history
When OnEndElement(...) is called ctxt.in_item is still > 0.
Therefore checking if the closing node is NODE_ITEM needs to happen
inside that conditional block to decrease ctxt.in_item and possibly
stop parsing.
  • Loading branch information
i-n-g-o authored and vslavik committed Nov 6, 2024
1 parent 587802c commit 4c74b89
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/appcast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ void XMLCALL OnEndElement(void *data, const char *name)
{
ctxt.in_dsasignature--;
}
}
else if (ctxt.in_channel && strcmp(name, NODE_ITEM) == 0)
{
ctxt.in_item--;
if (is_suitable_windows_item(ctxt.items[ctxt.items.size() - 1]))
XML_StopParser(ctxt.parser, XML_TRUE);
else if (strcmp(name, NODE_ITEM) == 0)
{
ctxt.in_item--;
if (is_suitable_windows_item(ctxt.items[ctxt.items.size() - 1]))
XML_StopParser(ctxt.parser, XML_TRUE);
}
}
else if (strcmp(name, NODE_CHANNEL) == 0 )
{
Expand Down

0 comments on commit 4c74b89

Please sign in to comment.