Re: [Cppcms-users] urlencode and base64_urlencode filters do not work...
Brought to you by:
artyom-beilis
|
From: Artyom <art...@ya...> - 2011-01-12 09:34:12
|
>
> base64_urlencode seems to be working now, but I still experience random (?)
> crashes with urlencode. I'll investigate more and let you know if I can narrow
>
> it down with a small example code.
>
Ok...
That was really embarrassing as three was a bug in urlencode for long time.
char c = ...;
char buf[4];
sprintf(buf,"%%%02x",(unsigned)c); // <- BUG HERE!
Together with the fact that I forgot include <cppcms/config.h> to get
CPPCMS_HAVE_SNPRINTF so it hadn't used protected version of
snprintf(buf,sizeof(buf),"%%%02x",(unsigned)c);
// Which is not correct as well, but not crashes.
and finally got buffer overflow...
Fixed in 1631 in CppCMS 1.x.x and in 1632 in CppCMS 0.0.x
P.S. Now I know why Unicode user names didn't worked in Wikipp....
Thanks a lot for reporting this bug.
Artyom
|