Windows crash in ctime_r()
authorMichael Schoberg (mschoberg) <mschoberg@micron.com>
Mon, 16 May 2016 21:50:19 +0000 (21:50 +0000)
committerJens Axboe <axboe@fb.com>
Tue, 17 May 2016 01:25:48 +0000 (19:25 -0600)
I think I found an issue in os\windows\posix.c that results in a FIO
crash (on Windows.)  I'm including a patch that resolves the crash for
us, but includes another (optional) fix.

Crash issue:  possix.c  - ctime_r() will reference a negative array
index on Sunday.  SYSTEMTIME states the days of the week as: "0=Sunday,
.. , 6=Saturday."  The "fix" can likely be dialed back to safely assume
the days/months will adhere to how they're documented.

Optional - StringCchPrintfA() calls should allow for the string plus a
NULL character.  Instead, the value getting passed in is for the entire
string size.

os/windows/posix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Signed-off-by: Jens Axboe <axboe@fb.com>

No differences found