summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2002-12-01 02:44:50 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2002-12-01 02:44:50 +0000
commitaeb6a6c45884133bd68535e671d44b8d2577b463 (patch)
treeb3e6096be4d44e74ea45c425d329263a5b91b94b
parent39e03b580b35be85faec65deca40cc443a6755be (diff)
downloadphp-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...
-rw-r--r--ext/standard/base64.c2
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.