diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index b2e5b161ed3..08df8bd627c 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -534,8 +534,8 @@ static inline xmlChar* trim_whitespace(xmlChar* str) while (*ret && isspace(*ret)) ++ret; len = xmlStrlen(ret); - while (isspace(ret[len-1])) - --len; + if (len) + while (isspace(ret[len-1])) --len; ret = xmlStrndup(ret, len); xmlFree(str);