Skip to content

Commit 68e0e88

Browse files
committed
- fix possible Dechunking Filter Buffer Overflow
1 parent 16d5d59 commit 68e0e88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/standard/filters.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@ typedef enum _php_chunked_filter_state {
19141914

19151915
typedef struct _php_chunked_filter_data {
19161916
php_chunked_filter_state state;
1917-
int chunk_size;
1917+
size_t chunk_size;
19181918
int persistent;
19191919
} php_chunked_filter_data;
19201920

@@ -1991,7 +1991,7 @@ static int php_dechunk(char *buf, int len, php_chunked_filter_data *data)
19911991
continue;
19921992
}
19931993
case CHUNK_BODY:
1994-
if (end - p >= data->chunk_size) {
1994+
if ((size_t) (end - p) >= data->chunk_size) {
19951995
if (p != out) {
19961996
memmove(out, p, data->chunk_size);
19971997
}

0 commit comments

Comments
 (0)