diff options
| author | Sara Golemon <pollita@php.net> | 2004-09-07 22:46:24 +0000 |
|---|---|---|
| committer | Sara Golemon <pollita@php.net> | 2004-09-07 22:46:24 +0000 |
| commit | 92c4a37a6a6bd6b7f05464a843f5ddbb769d8efa (patch) | |
| tree | b203fd2032d0c43a0cb01490e221814971be82bf | |
| parent | aa25757136e60dba00dd63c4d840654bc95d0c6e (diff) | |
| download | php-git-92c4a37a6a6bd6b7f05464a843f5ddbb769d8efa.tar.gz | |
Chunk Length may optionally be followed by whitespace
| -rw-r--r-- | ext/standard/http_fopen_wrapper.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 6198547fca..18c90359d4 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -186,6 +186,8 @@ continue_bucket: memcpy(data->chunksize_buffer_pos, buf, buflen); memset(data->chunksize_buffer_pos + buflen, 0, HTTP_CHUNK_SIZE_MAXLEN - buflen - (data->chunksize_buffer_pos - data->chunksize_buffer)); chunk_remaining = strtoul(data->chunksize_buffer, &e, 16); + /* Skip whitespace */ + while ((*e == ' ') && (e < (data->chunksize_buffer + HTTP_CHUNK_SIZE_MAXLEN))) e++; if (*e != '\r') { if (!((*e >= '0' && *e <= '9') || (*e >= 'a' && *e <= 'f') || @@ -201,6 +203,8 @@ continue_bucket: } else { memcpy(data->chunksize_buffer_pos, buf, HTTP_CHUNK_SIZE_MAXLEN - (data->chunksize_buffer_pos - data->chunksize_buffer)); chunk_remaining = strtoul(data->chunksize_buffer, &e, 16); + /* Skip whitespace */ + while ((*e == ' ') && (e < (data->chunksize_buffer + HTTP_CHUNK_SIZE_MAXLEN))) e++; if (*e != '\r') { /* Invalid chunksize */ return PSFS_ERR_FATAL; @@ -799,7 +803,6 @@ out: php_stream_filter_append(&stream->readfilters, filter); } } - } return stream; |
