[Live-devel] ServerMediaSession::generateSDPDescription breaks if time_t is a 64-bit long long but sizeof(long) == 4
gback
gback at cs.vt.edu
Thu Aug 1 09:18:30 PDT 2024
Hi,
in ServerMediaSession::generateSDPDescription the format specifier %ld
is used to print fCreationTime.tv_sec,
which treats this variable as if it is of type long. However, to avoid
the Year 2038 problem, time_t today is typically 64bit.
On machines using the LLP64 model, long is only 32bits and time_t is
expressed as a long long type.
Hence on those machines, this code breaks.
This was discovered (a long time ago?) by a Michel Promonet, a
contributor to Live555, but for whatever reason their patch
seems to have gotten lost. See the URL below.
Would you consider fixing this in the main Live555 codebase?
Godmar
https://github.com/themactep/thingino-firmware/blob/master/package/thingino-live555/0002_live555_sprintf_format.patch
More information about the live-devel
mailing list