In upnp/src/genlib/net/http/httpreadwrite.c, a function called gmtime() is used
to obtain a date string.
However, it is not thread-safe..
.
Found by running the code using valgrind.
Patch attached.
(Sorry, I am still new to git and I could not fix
the commit message that contained incorrect function name, and
so hand-editied it. I have no idea if there is any ill-effect to the resulting patch
although I don't see any proble with it ;-)
Windows version of gmtime uses thread local variable:
http://msdn.microsoft.com/en-us/library/0z9czt0w\(v=vs.80).aspx
> Both the 32-bit and 64-bit versions of gmtime, mktime, mkgmtime, and localtime
> all use a single tm structure per thread for the conversion. Each call to one of
> these functions destroys the result of any previous call.
Therefore, keep original code in #ifdef WIN32.
Updated diff to taake care of WIN32 issue.
I uploaded a patch that takes of WIN32 issue.
zephyrus,
I found gmtime is used in webserver.c too.
I'll commit a change for both.
Regards,
zephyrus,
I've pushed Commit:34a77cc095a6be89a7cb2d71202364c3cc7e8d26
in branch-1.6.x. Close this issue if it is OK.
Regards,
Thanks!
(Sorry I was tied up with day job and could not follow up on this quickly.)
Sorry I was not sure how to close this, but now I closed it!