apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan K√ľng <tortoise...@gmail.com>
Subject time functions on win32 don't check return values
Date Fri, 23 May 2008 16:39:35 GMT

Due to some crash reports we've been getting lately I discovered that 
apr in most time related functions don't check the return values of the 
win API functions. That leads to crashes.

For example, most crash reports we receive are happening in 
SystemTimeToAprExpTime() (file time\win32\time.c) because the statement 
dayoffset[xt->tm_mon] accesses illegal memory, and that's because 'xt' 
is not initialized at all. I've discovered that this happens (just one 
example) if in apr_time_exp_lt(), the call to 
SystemTimeToTzSpecificLocalTime() fails.

The reason we only got these crash reports very recently (we didn't get 
those before) is that the SP3 for Windows XP updated some registry keys 
to handle more daylight-saving infos for different locales. Apparently, 
SP3 only causes these problems if users tried to adjust their settings 
manually before according to this KB article:

I'm not sure if that article has a bug or if those users experiencing 
the crash made a mistake, but looking at the amount of crash reports we 
get I doubt it's a user mistake.
And considering that many people haven't installed SP3 yet I'm sure we 
will get a lot more of those reports in the future.

So to make it short:
I think apr should check the return values of those win API calls and 
return an error.


   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net

View raw message