version 1.1.1.3, 2013/07/22 01:32:11
|
version 1.1.1.4, 2013/10/14 08:02:43
|
Line 2358 PHPAPI int _php_stream_scandir(char *dirname, char **n
|
Line 2358 PHPAPI int _php_stream_scandir(char *dirname, char **n
|
} else { |
} else { |
if(vector_size*2 < vector_size) { |
if(vector_size*2 < vector_size) { |
/* overflow */ |
/* overflow */ |
|
php_stream_closedir(stream); |
efree(vector); |
efree(vector); |
return FAILURE; |
return FAILURE; |
} |
} |
Line 2371 PHPAPI int _php_stream_scandir(char *dirname, char **n
|
Line 2372 PHPAPI int _php_stream_scandir(char *dirname, char **n
|
nfiles++; |
nfiles++; |
if(vector_size < 10 || nfiles == 0) { |
if(vector_size < 10 || nfiles == 0) { |
/* overflow */ |
/* overflow */ |
|
php_stream_closedir(stream); |
efree(vector); |
efree(vector); |
return FAILURE; |
return FAILURE; |
} |
} |
Line 2379 PHPAPI int _php_stream_scandir(char *dirname, char **n
|
Line 2381 PHPAPI int _php_stream_scandir(char *dirname, char **n
|
|
|
*namelist = vector; |
*namelist = vector; |
|
|
if (compare) { | if (nfiles > 0 && compare) { |
qsort(*namelist, nfiles, sizeof(char *), (int(*)(const void *, const void *))compare); |
qsort(*namelist, nfiles, sizeof(char *), (int(*)(const void *, const void *))compare); |
} |
} |
return nfiles; |
return nfiles; |