com php-src: Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag: ext/intl/locale/locale_methods. c

From: Date: Mon, 21 Oct 2013 05:04:21 +0000
Subject: com php-src: Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag: ext/intl/locale/locale_methods. c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-73756@lists.php.net to get a copy of this message
Commit: dab1d76e9def81acd51d2ea9ed55c74af1a093ed Author: Stanislav Malyshev <stas@php.net> Sun, 20 Oct 2013 22:04:21 -0700 Parents: 9aad9114e3566780c3c7a383acd983b7b861a3f4 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=dab1d76e9def81acd51d2ea9ed55c74af1a093ed Log: Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag Changed paths: M ext/intl/locale/locale_methods.c Diff: diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 1707c69..9c5b09a 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -127,6 +127,9 @@ static char* getPreferredTag(char* gf_tag) int grOffset = 0; grOffset = findOffset( LOC_GRANDFATHERED ,gf_tag); + if(grOffset < 0) { + return NULL; + } if( grOffset < LOC_PREFERRED_GRANDFATHERED_LEN ){ /* return preferred tag */ result = estrdup( LOC_PREFERRED_GRANDFATHERED[grOffset] );

« previous php.cvs (#73756) next »