From: Anatol Belski Date: Thu, 24 Sep 2015 05:18:31 +0000 (+0200) Subject: add ovfl check, fix warnings X-Git-Tag: php-7.0.0RC4~4^2~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7552ca31097b0be405dc324be11c77109e09a4e;p=php add ovfl check, fix warnings --- diff --git a/ext/dom/text.c b/ext/dom/text.c index bdd6e38f40..83216725be 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -164,13 +164,13 @@ PHP_FUNCTION(dom_text_split_text) } length = xmlUTF8Strlen(cur); - if (offset > length || offset < 0) { + if (ZEND_LONG_INT_OVFL(offset) || (int)offset > length || offset < 0) { xmlFree(cur); RETURN_FALSE; } - first = xmlUTF8Strndup(cur, offset); - second = xmlUTF8Strsub(cur, offset, length - offset); + first = xmlUTF8Strndup(cur, (int)offset); + second = xmlUTF8Strsub(cur, (int)offset, (int)(length - offset)); xmlFree(cur);