Browse Source

XML backend: fix test6 for libexpat

When feeding the expat-based XML backend, an off-by-one error
introduced an infinite loop in the backend code. The behavior
is triggered when the action is long enough (>2048 bytes).

This patch correct this issue.
Emmanuel Deloget 12 years ago
parent
commit
90323e64d7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      clish/shell/shell_expat.c

+ 1 - 1
clish/shell/shell_expat.c

@@ -447,7 +447,7 @@ int clish_xmlnode_get_content(clish_xmlnode_t *node, char *content,
 			children = children->next;
 		}
 		if (minlen >= *contentlen) {
-			*contentlen = minlen;
+			*contentlen = minlen + 1;
 			return -E2BIG;
 		}
 		children = node->children;