|
[SNIP]
Here wbuf[] get's dynamically allocated on the string. As soon, as the function returns, wcp[] might be overwritten. Better do this:
[SNIP]Very true. This same bug also exists in sslstream.c. I think this code is part of Mike Madore's original source! Or, at the very least, it's been there as long as I can remember. I'm glad you caught it.
char *wcp static char wbuf[10]; ... default: snprintf(wcp=wbuf, sizeof(wbuf), "<%02X>", what); "snprintf", btw, is the 21st century version of "sprintf" :-)
Heh... this is old code -- from the 20th century! I'll fix it, though. I've committed fixes to CVS, so if you checkout the latest code, it should be fixed.
Thanks for your help!
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.