mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
Heiko Rupp pointed that the shell would crash on empty nodesets returns.
* debugXML.c: Heiko Rupp pointed that the shell would crash on empty nodesets returns. Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
Wed Nov 7 14:32:55 CET 2001 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* debugXML.c: Heiko Rupp pointed that the shell would crash
|
||||
on empty nodesets returns.
|
||||
|
||||
Wed Nov 7 13:52:36 CET 2001 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* Makefile.am: Weiqi Gao pointed out that xmlcatalog
|
||||
|
11
debugXML.c
11
debugXML.c
@ -2038,6 +2038,9 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
case XPATH_NODESET:{
|
||||
int indx;
|
||||
|
||||
if (list->nodesetval == NULL)
|
||||
break;
|
||||
|
||||
for (indx = 0;
|
||||
indx < list->nodesetval->nodeNr;
|
||||
indx++) {
|
||||
@ -2112,6 +2115,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
"%s: no such node\n", arg);
|
||||
break;
|
||||
case XPATH_NODESET:
|
||||
if (list->nodesetval != NULL) {
|
||||
if (list->nodesetval->nodeNr == 1) {
|
||||
ctxt->node = list->nodesetval->nodeTab[0];
|
||||
} else
|
||||
@ -2119,6 +2123,10 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
"%s is a %d Node Set\n",
|
||||
arg,
|
||||
list->nodesetval->nodeNr);
|
||||
} else
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"%s is an empty Node Set\n",
|
||||
arg);
|
||||
break;
|
||||
case XPATH_BOOLEAN:
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
@ -2183,6 +2191,9 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
case XPATH_NODESET:{
|
||||
int indx;
|
||||
|
||||
if (list->nodesetval == NULL)
|
||||
break;
|
||||
|
||||
for (indx = 0;
|
||||
indx < list->nodesetval->nodeNr;
|
||||
indx++) {
|
||||
|
Reference in New Issue
Block a user