Commit graph

4 commits

Author SHA1 Message Date
Dan Klishch 2f7527b0a4 LibXML: Actually append resolved references when parsing content 2023-07-23 16:09:12 +02:00
sin-ack 3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
Idan Horowitz 18d25124bf LibXML: Fail gracefully on integer overflow in character references
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47738
2022-07-10 22:29:11 +03:00
Luke Wilde adb5f7e485 LibXML+Tests: Consume > in the character data ending ]]> and test it
For example, with this input:
```xml
<C>]]>
```
After seeing `<C>`, the parser will start parsing the content of the
element. The content parser will then parse any character data it sees.

The character parser would see the first two `]]` and consume them.
Then, it would see the `>` and set the state machine to say we have
seen this, but it did _not_ consume it and would instead tell
GenericLexer that it should stop consuming characters. Therefore,
we only consumed 2 characters.

Then, it would see that we are in the state where we've seen the
full `]]>` and try to take off three characters from the end of the
consumed input when we only have 2 characters, causing an assertion
failure as we are asking to take off more characters than there really
is.
2022-05-30 00:16:17 +01:00