Comment # 18
on bug 8962
from Guy Harris
(In reply to comment #17)
> (In reply to comment #16)
> > You read a 64-bit seconds value from the packet, but there are some
> > platforms on which the time_t we store it in is only 32-bits. I've added
> > casts for now, but there may be explicit handling you want to do in case
> > that field is less than 8 bytes.
>
> That probably won't be a problem until 2038, at which time, if NATO and
> Wireshark are both still around, hopefully few if any systems with 32-bit
> time_t values will be running Wireshark. :-)
...and he's not reading a 64-bit seconds value from the packet; he's reading a
Reference Time in the form of year/month/day, as per sections 2.3.5, 2.3.6, and
2.3.7 of
http://www.nato.int/structur/AC/224/standard/4607/4607e_JAS_ED3.pdf
and converting that to seconds-since-the-Epoch using gmtime(). If time_t is 32
bits, that's not going to be able to return a 64-bit seconds value; what it
will do if year is, say, 2039 is unknown.
So base_secs should be a time_t, which eliminates the need for the cases.
However, base_secs shouldn't be static, it should be per-wrap-structure; I've
checked in a change to make it a time_t and make it part of a private data
structure, so more than one STANAG 4607 file can be open at a time.
You are receiving this mail because:
- You are watching all bug changes.