Replies: 1 comment 1 reply
-
prev_sibling_c should never be null unless the node was removed from the tree (in which case it's invalid to work with the node and other functions may result in a crash). _c refers to "cyclic": in the first child, this pointer points to the last sibling (if present) or the node itself if absent |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There is this line can be a potential defect since looks like _root->prev_sibling_c might be null. Not sure if there is anything which prevents this happening, but looks like a crash could be related to this check in one of oldest version of the library (I cannot be more specific since it is related to code I cannot share). Just in case anyone has a chance to refactor it, it would be safer and more robust checking _root->prev_sibling_c is not null either (as it is done for _root pointer in the same method).
pugixml/src/pugixml.cpp
Line 5618 in 9e382f9
Beta Was this translation helpful? Give feedback.
All reactions