httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <>
Subject Re: [PATCH] Win32 strftime
Date Mon, 02 Nov 1998 06:44:27 GMT
On Sat, Oct 31, 1998 at 05:30:07PM -0700, Marc Slemko wrote:
> The use of malloc() isn't safe because we could timeout in the middle.

Ouch. yes.

> You can use alloca as an alternative if it works on Win32.

In util_win32.c, _alloca seems to be used instead. In http_main.c,
it's just alloca. Is _alloca preferred on Win32?

> eg. strftime(out, 6, "%%%%%%%%%%") is valid.  If you change 6 to 600 and
> give 1200 '%'s instead, then it looks like your code will fail;
> gracefully, but still a fail.  I wouldn't worry about that one though.

This case actually wouldn't be too hard to fix. If "%%" is handled in
the adapter function as well, then this case is taken care of. There
are other cases where this can crop up, though. "%p" supposedly
returns nothing in some locales. The only way to truly fix this would
be to add a full strftime-implementation, or to throw in some reallocs.

After adding a "%%" check and fixing the malloc, are there any objections?

View raw message