-
-
Notifications
You must be signed in to change notification settings - Fork 904
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
Custom xpath function segfault #634
Labels
topic/memory
Segfaults, memory leaks, valgrind testing, etc.
Comments
Valgrind sez:
|
Testing fix. |
Looks like the node set is null. How about: diff --git a/ext/nokogiri/xml_node_set.c b/ext/nokogiri/xml_node_set.c
index 155e76e..fe608a8 100644
--- a/ext/nokogiri/xml_node_set.c
+++ b/ext/nokogiri/xml_node_set.c
@@ -425,7 +425,7 @@ VALUE Nokogiri_wrap_xml_node_set(xmlNodeSetPtr node_set, VALUE document)
rb_funcall(document, decorate, 1, new_set);
}
- if (node_set->nodeTab) {
+ if (node_set && node_set->nodeTab) {
for (i = 0; i < node_set->nodeNr; i++) {
cur = node_set->nodeTab[i];
if (cur && cur->type == XML_NAMESPACE_DECL) |
Thanks! |
flavorjones
added
the
topic/memory
Segfaults, memory leaks, valgrind testing, etc.
label
Feb 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reported by Andrew Crump on the nokogiri-talk mailing list:
The text was updated successfully, but these errors were encountered: