Browse Source

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...
experimental/threaded
Moriyoshi Koizumi 24 years ago
parent
commit
aeb6a6c458
  1. 2
      ext/standard/base64.c

2
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.

Loading…
Cancel
Save