Hi

Here's a bug report from Andrew Kurushin, forwarded with permission.

 / daniel.haxx.se

---------- Forwarded message ----------
Date: Fri, 4 Feb 2011 09:12:44
From: Andrew Kurushin <[email protected]>
Subject: curl gmtime bug

Hello



Http.c Function Curl_add_timecondition contains AccessViolation bug:



gmtime (msvcrt implementation)- may return NULL for invalid input data, in
that case following "snprintf" generate AccessViolation.

Workaround:

#ifdef HAVE_GMTIME_R

  /* thread-safe version */

  struct tm keeptime;

  tm = (struct tm *)gmtime_r(&data->set.timevalue, &keeptime);

#else

  tm = gmtime(&data->set.timevalue);

#endif



if (tm == NULL) {

return result; //CURLE_OK. We do not need to abort request if conditional
time is invalid. We just process with unconditional request path

}



Thanks

Andrei



-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to