[chrony-dev] NTP packet with valid header but not data

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


While investigating a valgrind error about using uninitialized memory
I've noticed something in ntp_core.c I'm not sure is correct.

The source is set as reachable if the packet has a valid header and
samples are pushed to sourcestats if data are valid. If the packet has
only valid header, the source will be set as reachable, but there will
be no data in sourcestats so uninitialized memory will be read in
source selection algorithm.

Is there a reason for this? Or for the other case when only data are
valid? The code seems to be unchanged from the 1st version in CVS. I
think we should use the packet only when both data and header are
valid.

Another (possibly related) thing is that the header is not considered as
valid if stratum > our_stratum.

I'd like to push this patch to git, can anyone please check I'm not
doing something stupid?

Thanks,

-- 
Miroslav Lichvar






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/