diff options
author | Moriyoshi Koizumi <moriyoshi@php.net> | 2002-12-01 02:44:50 +0000 |
---|---|---|
committer | Moriyoshi Koizumi <moriyoshi@php.net> | 2002-12-01 02:44:50 +0000 |
commit | aeb6a6c45884133bd68535e671d44b8d2577b463 (patch) | |
tree | b3e6096be4d44e74ea45c425d329263a5b91b94b /ext/standard/base64.c | |
parent | 39e03b580b35be85faec65deca40cc443a6755be (diff) | |
download | php-git-aeb6a6c45884133bd68535e671d44b8d2577b463.tar.gz |
Fixed possible buffer overflow in php_base64_decode();
# This bug doesn't appear to be harmful for now,
# so I won't merge it into branches...
Diffstat (limited to 'ext/standard/base64.c')
-rw-r--r-- | ext/standard/base64.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 18f1e9c532..4fefd1bc54 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -140,7 +140,7 @@ unsigned char *php_base64_decode(const unsigned char *str, int length, int *ret_ } /* run through the whole string, converting as we go */ - while ((ch = *current++) != '\0') { + while ((ch = *current++) != '\0' && length-- > 0) { if (ch == base64_pad) break; /* When Base64 gets POSTed, all pluses are interpreted as spaces. |