Hello all.

While investigating a crash when a camera sent multicast details in the SDP, I 
tracked down the problem to timestampString in GroupsockHelper which turned out 
to be an Invalid argument exception being raised inside ctime (actually 
_tctime64, calling _localtime64_s).

When using Windows SDK 7.1, time_t is defined as a 64 bit value by default 
(__time64_t) and due to an invalid cast resulted in a massively out of range 
value.

char const* ctimeResult = ctime((time_t*)&tvNow.tv_sec);

The 32-bit seconds value (followed by the 32-bit microseconds value) is cast to 
a single 64-bit seconds value giving a unix time of 2816954497596031 instead of 
a far more reasonable 1412266623.

Doing an implicit cast/assignment to a real time_t value and passing a pointer 
to that, resolves the crash.

time_t tvNow_t = tvNow.tv_sec;
char const* ctimeResult = ctime(&tvNow_t);

Would you consider including the attached patch in the next release of 
liveMedia?

Many thanks.

-- 
Deanna Earley | Lead developer | icatchercctv

w: www.icode.co.uk/icatcher | t: 01329 835335 | f: 01329 835338
Registered Office : 71 The Hundred, Romsey, SO51 8BZ. Company Number : 03428325

Attachment: liveMedia GroupsockHelper timestampString invalidcast.patch
Description: liveMedia GroupsockHelper timestampString invalidcast.patch

_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to