libixp
libixp copied to clipboard
str_of_time() bug in libixp-main/cmd/ixpc.c
trafficstars
- The sample client libixp-main/cmd/ixpc.c has a bug in str_of_time(), line 83 (as of this bug filing time):
https://github.com/0intro/libixp/blob/1c157b5b42adb2c1c9aea375bd23200f61671c26/cmd/ixpc.c#L83
ctime_r((time_t*)&val, buf);
-
On 64-bit ubuntu, this results in an empty string in my test cases. val is a uint, and time_t is not a uint. sizeof(time_t) == 8, and sizeof(uint) == 4.
-
Proposed fix:
replace line 83 (see #1 above) with:
time_t t = val; ctime_r(&t, buf);