summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmain/streams/streams.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 1945724..81bf594 100755
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -2280,6 +2280,11 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_
if (vector_size == 0) {
vector_size = 10;
} else {
+ if(vector_size*2 < vector_size) {
+ /* overflow */
+ efree(vector);
+ return FAILURE;
+ }
vector_size *= 2;
}
vector = (char **) safe_erealloc(vector, vector_size, sizeof(char *), 0);