diff options
Diffstat (limited to 'usr.sbin/xntpd/xntpdc/ntpdc.c')
-rw-r--r-- | usr.sbin/xntpd/xntpdc/ntpdc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/xntpd/xntpdc/ntpdc.c b/usr.sbin/xntpd/xntpdc/ntpdc.c index 001bd77..aae1b40 100644 --- a/usr.sbin/xntpd/xntpdc/ntpdc.c +++ b/usr.sbin/xntpd/xntpdc/ntpdc.c @@ -598,8 +598,12 @@ again: /* * So far, so good. Copy this data into the output array. */ - if ((datap + datasize) > (pktdata + pktdatasize)) + if ((datap + datasize) > (pktdata + pktdatasize)) { + int offset = datap - pktdata; growpktdata(); + *rdata = pktdata; /* might have been realloced ! */ + datap = pktdata + offset; + } memmove(datap, (char *)rpkt.data, datasize); datap += datasize; if (firstpkt) { |