diff options
Diffstat (limited to 'contrib/ntp/ntpd/refclock_shm.c')
-rw-r--r-- | contrib/ntp/ntpd/refclock_shm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/ntp/ntpd/refclock_shm.c b/contrib/ntp/ntpd/refclock_shm.c index f3e7f51..f031a39 100644 --- a/contrib/ntp/ntpd/refclock_shm.c +++ b/contrib/ntp/ntpd/refclock_shm.c @@ -600,7 +600,7 @@ shm_timer( cd.year, cd.month, cd.monthday, cd.hour, cd.minute, cd.second, (long)shm_stat.tvt.tv_nsec); - pp->lencode = (c < sizeof(pp->a_lastcode)) ? c : 0; + pp->lencode = (c > 0 && (size_t)c < sizeof(pp->a_lastcode)) ? c : 0; /* check 1: age control of local time stamp */ tt = shm_stat.tvc.tv_sec - shm_stat.tvr.tv_sec; |