[base64] fix crash due to broken force_assert

if the input to `li_to_base64_no_padding` has length 3*n,
`out_tuple_remainder` = `in_tuple_remainder` = 0, and `4*full_tuples
== 4*full_tuples + out_tuple_remainder`

From: Andrey Mnatsakanov <andrey.mnatsakanov@gmail.com>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3117 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/heads/lighttpd-1.4.x
Andrey Mnatsakanov 6 years ago committed by Stefan Bühler
parent 5c68caa6d7
commit 7b983ae054
  1. 1
      NEWS
  2. 2
      src/base64.c

@ -44,6 +44,7 @@ NEWS
* consistent inclusion of config.h at top of files (fixes #2073)
* [core] add generic vector implementation
* [core] replace array weakref with vector
* [base64] fix crash due to broken force_assert
- 1.4.39 - 2016-01-02
* [core] fix memset_s call (fixes #2698)

@ -144,7 +144,7 @@ size_t li_to_base64_no_padding(char* out, size_t out_length, const unsigned char
/* check overflows */
force_assert(full_tuples < 2*full_tuples);
force_assert(full_tuples < 4*full_tuples);
force_assert(4*full_tuples < 4*full_tuples + out_tuple_remainder);
force_assert(4*full_tuples <= 4*full_tuples + out_tuple_remainder);
force_assert(require_space <= out_length);
for (i = 2; i < in_length; i += 3) {

Loading…
Cancel
Save