[vlc-devel] XML parsing

Rémi Denis-Courmont remi at remlab.net
Thu Jan 20 22:34:24 CET 2011


	Hello,

I complained many times about the hand-coded broken XML parsing in the ASX 
demux. But unfortunately, most of the other XML parsers are quite broken as 
well.

I tried to fix a few memory leaks and simplify the API a little. However, with 
about a thousand lines of reworked code, the probability that I introduced 
regressions is approximately 100%. I simply could not test anything for lack 
of samples.

In the process or revectoring, I found some rather suspicious stuff, in most 
code paths:
- Attribute values or text often duplicated and stored into pointers. In many 
cases, this will leak if the attribute or the text is duplicated.
- String pointers not freed in some corner cases.
- Use-after-free (at least in XSPF).
- Assumptions that start and end tags are well paired.

Basically, most if not all of the parser are horribly broken in some way. In 
particular, most of them fail to parse tags recursively and leak on malformed 
inputs. I am _NOT_ going to fix the parsers on my free time.

I did not write them to begin with so I feel no moral obligation. Besides, I 
do not have time for this and I am getting really fed up with this mess. I 
spent already 3 or 4 days reworking this, and the rework is not even finished.


Also, LUA is broken due to API changes. I don't know LUA well enough to fix 
and verify it.

Have a nice weekend.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list