Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/icu/source/common/putil.c

Issue 257012: Work around a crash in putil.c in ICU (searchForTZFile).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/icu/patches/linuxtz.patch ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ****************************************************************************** 2 ******************************************************************************
3 * 3 *
4 * Copyright (C) 1997-2009, International Business Machines 4 * Copyright (C) 1997-2009, International Business Machines
5 * Corporation and others. All Rights Reserved. 5 * Corporation and others. All Rights Reserved.
6 * 6 *
7 ****************************************************************************** 7 ******************************************************************************
8 * 8 *
9 * FILE NAME : putil.c (previously putil.cpp and ptypes.cpp) 9 * FILE NAME : putil.c (previously putil.cpp and ptypes.cpp)
10 * 10 *
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 static char SEARCH_TZFILE_RESULT[MAX_PATH_SIZE] = ""; 842 static char SEARCH_TZFILE_RESULT[MAX_PATH_SIZE] = "";
843 static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) { 843 static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) {
844 DIR* dirp = opendir(path); 844 DIR* dirp = opendir(path);
845 DIR* subDirp = NULL; 845 DIR* subDirp = NULL;
846 struct dirent* dirEntry = NULL; 846 struct dirent* dirEntry = NULL;
847 847
848 char* result = NULL; 848 char* result = NULL;
849 849
850 /* Save the current path */ 850 /* Save the current path */
851 char curpath[MAX_PATH_SIZE]; 851 char curpath[MAX_PATH_SIZE];
852
853 if (dirp == NULL)
854 return result;
855
852 uprv_memset(curpath, 0, MAX_PATH_SIZE); 856 uprv_memset(curpath, 0, MAX_PATH_SIZE);
853 uprv_strcpy(curpath, path); 857 uprv_strcpy(curpath, path);
854 858
855 /* Check each entry in the directory. */ 859 /* Check each entry in the directory. */
856 while((dirEntry = readdir(dirp)) != NULL) { 860 while((dirEntry = readdir(dirp)) != NULL) {
857 if (uprv_strcmp(dirEntry->d_name, SKIP1) != 0 && uprv_strcmp(dirEntry->d _name, SKIP2) != 0) { 861 if (uprv_strcmp(dirEntry->d_name, SKIP1) != 0 && uprv_strcmp(dirEntry->d _name, SKIP2) != 0) {
858 /* Create a newpath with the new entry to test each entry in the dir ectory. */ 862 /* Create a newpath with the new entry to test each entry in the dir ectory. */
859 char newpath[MAX_PATH_SIZE]; 863 char newpath[MAX_PATH_SIZE];
860 uprv_strcpy(newpath, curpath); 864 uprv_strcpy(newpath, curpath);
861 uprv_strcat(newpath, dirEntry->d_name); 865 uprv_strcat(newpath, dirEntry->d_name);
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 } 1932 }
1929 1933
1930 /* 1934 /*
1931 * Hey, Emacs, please set the following: 1935 * Hey, Emacs, please set the following:
1932 * 1936 *
1933 * Local Variables: 1937 * Local Variables:
1934 * indent-tabs-mode: nil 1938 * indent-tabs-mode: nil
1935 * End: 1939 * End:
1936 * 1940 *
1937 */ 1941 */
OLDNEW
« no previous file with comments | « third_party/icu/patches/linuxtz.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698