[En-Nut-Discussion] Problem with NutDecodeBase64
Adrian Slowik
adrian at uni-paderborn.de
Tue Mar 25 14:09:07 CET 2003
Hi,
I am using Nut/OS 3.0.1 and came across a bug in pro/dencode.c.
There is a problem with signed/unsigend values within the
function NutDecodeBase64. It leads to wrong results if
the length of the input string is not a multiple of 4. Thus
for example http authentication fails if the length of the
"user:password" configuration is not a multiple of 3, as
"root:root" unfortunately :-) is.
My current workaround is to use
if ((code = PRG_RDB(&base64dtab[(int) *sp])) == 255)
instead of
if ((code = PRG_RDB(&base64dtab[(int) *sp])) == -1)
since PRG_RDB(x) always produces an unsigned result (at least with
my avr-gcc 3.3 and Nut/OS 3.0.1). But I did not try to find out whether
PRG_RDB should be defined different, or what the dependencies among
the data types and macros like prog_char etc. are ...
Kind regards, Adrian
More information about the En-Nut-Discussion
mailing list