--- embedaddon/php/ext/intl/locale/locale_methods.c 2013/07/22 01:31:52 1.1.1.3 +++ embedaddon/php/ext/intl/locale/locale_methods.c 2014/06/15 20:03:49 1.1.1.4 @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: locale_methods.c,v 1.1.1.3 2013/07/22 01:31:52 misho Exp $ */ +/* $Id: locale_methods.c,v 1.1.1.4 2014/06/15 20:03:49 misho Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -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] );