Fix potential buffer overrun by 1 byte in base64Decode caused by bad docs from APR-Util. See #255.

This commit is contained in:
brectanus 2007-09-21 00:20:31 +00:00
parent b217e42624
commit eb6b456f5b
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,9 @@
?? ??? 2007 - 2.5.0-dev3
------------------------
* Fixed potential corruption at end of strings after using base64Decode
(APR-Util issue). TODO make a better CHANGELOG entry ;)
* Return from the output filter with an error in addition to setting
up the HTTP error status in the output data.

View File

@ -311,8 +311,7 @@ static int msre_fn_base64Decode_execute(apr_pool_t *mptmp, unsigned char *input,
{
*rval_len = apr_base64_decode_len((const char *)input); /* returns len with NULL byte included */
*rval = apr_palloc(mptmp, *rval_len);
apr_base64_decode(*rval, (const char *)input);
(*rval_len)--;
*rval_len = apr_base64_decode(*rval, (const char *)input);
return 1;
}