1
0
Fork 0

Bug fix: if "char" is unsigned (as on some architectures), b64decode() fails

This commit is contained in:
John Zaitseff 2017-06-15 11:40:24 +10:00
parent 3d390967af
commit 6433c44dee
2 changed files with 8 additions and 1 deletions

7
NEWS
View File

@ -15,6 +15,13 @@ browse the Git repository on The ZAP Group web server at the following
location: http://www.zap.org.au/gitweb/trader.git
Version 7.11 (not yet released)
-------------------------------
Minor bug fix: some architectures treat "char" as "unsigned char", and
this caused b64decode() to fail.
Version 7.10 (2nd June, 2017)
-----------------------------

View File

@ -873,7 +873,7 @@ ssize_t b64decode (const void *restrict in, size_t inlen,
n = 1;
for (size_t i = 0; i < inlen && *u_in != '\0'; i++, u_in++) {
char c = *u_in > UNSCRAMBLE_TABLE_SIZE ?
signed char c = *u_in > UNSCRAMBLE_TABLE_SIZE ?
UNSCRAMBLE_INVALID : unscramble_table[*u_in];
switch (c) {