mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
libc_ffat: zero-init 'struct tm' on stack
This prevents the following runtime error. Error: mktime() returned -1, the file modification time reported by stat() will be incorrect
This commit is contained in:
@@ -718,6 +718,8 @@ class Plugin : public Libc::Plugin
|
||||
/* TODO: handle more attributes */
|
||||
|
||||
struct tm tm;
|
||||
::memset(&tm, 0, sizeof(tm));
|
||||
|
||||
tm.tm_year = ((file_info.fdate & 0b1111111000000000) >> 9) + 80;
|
||||
tm.tm_mon = (file_info.fdate & 0b0000000111100000) >> 5;
|
||||
tm.tm_mday = (file_info.fdate & 0b0000000000011111);
|
||||
|
||||
Reference in New Issue
Block a user