Commit:    444612cdc48d68e94c5a94aa47153a2b3933470a
Author:    Stanislav Malyshev <s...@php.net>         Sun, 20 Oct 2013 22:04:21 
-0700
Parents:   219a682e8e977ebe1df49c29c51d52a044a09f8f
Branches:  master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=444612cdc48d68e94c5a94aa47153a2b3933470a

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 d1a86d8..915f4d5 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] );


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to