New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ofXml error on comment #3760
Comments
@joshuajnoble , any idea? |
@turowskipaul I failed to replicate the bug as of c214832. I have tested different scenarios. Can you post example data and code which triggers the bug? |
Thanks for testing. Here is some code: testing.xml
ofApp.h
ofApp.cpp
Console output
stops on string ofXml::getValue() const, with error:
The crash can be avoided with a simple test, like so: ofApp.h
ofApp.cpp
Console output
However, it's still not storing the correct number of values because setToSibling() is stopping on the commented line. In short, getNumChildren() and setToSibling() seem to be inconsistent. |
@turowskipaul thank you for the data. I can replicate the bug for a7a6e5b. |
The data provided triggers multiple bugs . I fixed the NULL pointer dereference in getValue() (see my local branch). I am currently looking into the |
@tpltnt Ah, I was going to look at this a little later today but it seems like you've got it handled so maybe I'll leave it to you? My guess is that the setToSibling() and getNumChildren() need better filtering because POCO reports everything as a child, whitespace, etc. It's probably just a matter of tracking down the type for commented nodes and ensuring that those don't get included in the count. I don't remember the documentation for poco::xml being all that thorough but it might be better now. |
I think i fixed this issue. I do have a personal test suite and ran the code posted which yields the following output:
@turowskipaul Can you check out my branch and check if your (other) code works now? (I want your ok as a basic quality check before issuing a pull request.) |
Worked for me. Cheers! |
@turowskipaul please reopen since the issue still exits. My stuff has not been merged yet. |
sorry! |
@turowskipaul no problem |
closed by #4151 |
In the ofXml class, when I try to read through an XML file sequentially using the setToSibling() method, I get EXC_BAD_ACCESS from getValue() when a commented line, like
<!-- <pRangeMin>36</pRangeMin>-->
is encountered.
The text was updated successfully, but these errors were encountered: