summaryrefslogtreecommitdiffstats
path: root/usr.sbin/xntpd/patches/patch.12
blob: 9d7db0f15fafe60a06d9a2c2eb527c9a05b37b4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

Received: from louie.udel.edu by huey.udel.edu id aa16020; 11 Feb 94 10:28 EST
Received: from faui45.informatik.uni-erlangen.de by louie.udel.edu id aa27338;
          11 Feb 94 10:12 EST
Received: from faui43.informatik.uni-erlangen.de by uni-erlangen.de with SMTP;
	id AA00715 (5.65c-6/7.3v-FAU); Fri, 11 Feb 1994 14:26:34 +0100
Received: from faui45x.informatik.uni-erlangen.de by immd4.informatik.uni-erlangen.de with SMTP;
	id AA24390 (5.65c-6/7.3m-FAU); Fri, 11 Feb 1994 14:26:31 +0100
From: Frank Kardel <Frank.Kardel@informatik.uni-erlangen.de>
Message-Id: <199402111326.AA24390@faui43.informatik.uni-erlangen.de>
Subject: Re:  Beep, beep, beep
To: Mills@udel.edu
Date: Fri, 11 Feb 94 14:26:25 MET
Cc: Frank.Kardel@informatik.uni-erlangen.de, 
    Paul_Vixie@corpmis.sjc.hw.sony.com, Piete.Brooks@cl.cam.ac.uk
In-Reply-To:  <9402101138.aa10259@huey.udel.edu>; from "Mills@udel.edu" at Feb 10, 94 11:38 am
X-Mailer: ELM [version 2.3 PL11]


> Frank,

> In the latest xntp3.3zz.tar.Z the Ultrix kernel finds joy of clock.
> (Whew).

Ok, I just dug out an old allocation failure in xntpdc. While
reading respones the input buffer might be realloced(and MOVED) without
telling the rest of the system. This was fatal when stdio needed a
buffer for non terminal operation. Net result was confused output.

Ok, here ist the patch:

===================================================================
RCS file: /src/NTP/REPOSITORY/v3/xntpdc/ntpdc.c,v
retrieving revision 3.17
diff -c -r3.17 xntpdc/ntpdc.c
*** xntpdc/ntpdc.c:3.17	1994/01/28 14:07:13
--- xntpdc/ntpdc.c	1994/02/11 13:20:56
***************
*** 598,605 ****
  	/*
  	 * So far, so good.  Copy this data into the output array.
  	 */
! 	if ((datap + datasize) > (pktdata + pktdatasize))
  		growpktdata();
  	memmove(datap, (char *)rpkt.data, datasize);
  	datap += datasize;
  	if (firstpkt) {
--- 598,609 ----
  	/*
  	 * So far, so good.  Copy this data into the output array.
  	 */
! 	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) {

-- 
	   Frank Kardel (kardel@informatik.uni-erlangen.de)
    All SCSI disks will from now on be required to send an email
         notice 24 hours prior to complete hardware failure!

OpenPOWER on IntegriCloud