slackbuilds_ponce/libraries/pjproject-ring/patches/fix_base64.patch
Mario Preksavec 9d5aad10de libraries/pjproject-ring: Added (Multimedia Communication Library).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
2017-08-12 06:57:39 +07:00

20 lines
588 B
Diff

--- a/pjlib-util/src/pjlib-util/base64.c 2017-05-03 10:29:07.200417026 -0400
+++ b/pjlib-util/src/pjlib-util/base64.c 2017-05-03 10:28:30.344335390 -0400
@@ -131,7 +131,7 @@
PJ_ASSERT_RETURN(input && out && out_len, PJ_EINVAL);
- while (buf[len-1] == '=' && len)
+ while (len && buf[len-1] == '=')
--len;
PJ_ASSERT_RETURN(*out_len >= PJ_BASE64_TO_BASE256_LEN(len),
@@ -161,7 +161,7 @@
out[j++] = (pj_uint8_t)(((c[2] & 0x03)<<6) | (c[3] & 0x3F));
}
- pj_assert(j < *out_len);
+ pj_assert(j <= *out_len);
*out_len = j;
return PJ_SUCCESS;