Closed sixten closed 15 years ago
nice detective work. I'll add the initializer although I am not convinced that it can actually occur.
Well, that definitely happens with static analysis bugs: the compiler doesn't know anything about usage.
best to keep the compiler happy! BTW, any feedback on ElementParser? Useful? Have you/would you recommend?
In the method
parseHTML:delegate:selector:context:index:partial:
(in NSString_HTML.m), you might want to set a default value for the local varlen
. Clang was able to find a path through the method where it doesn't get a value before it's passed toNSMakeRange()
on line 458. Looks like it works like this:c
gets the ampersand.len
is allocated on line 374.interior
is zero,partialChunk
is set, but notlen
(lines 432-7).len
then gets initialized on line 450, but if the conditional on line 446 is true, execution won't reach that line. (Or if, for whatever reason,partialChunk
ended up nil on line 444).Now, whether this is likely to actually happen, I couldn't say. I suspect you might be able to craft an input document that would do this, though. At any rate, take it for what it's worth. :-)