9fans archive / 1998 / 12 / 21 /    prev next

From: arisawa@ar.aichi-u.ac.jp arisawa@ar.aichi-u.ac.jp
Subject: [9fans] dnserver.c
Date: Wed, 16 Dec 1998 02:48:31 -0500 (EST)

Hello 9fans!

It seems to me the following codes are buggy.
		len = read(fd, buf, sizeof(buf));
		getactivity();  /* this line is added by the boddle 811708952 */
		err = convM2DNS(&buf[Udphdrsize], len, &reqmsg);
 in dnsserver() in ndb/dnserver.c

I think they should be:
		len = read(fd, buf, sizeof(buf));
		getactivity();  /* this line is added by the boddle 811708952 */
		len -= Udphdrsize;
		err = convM2DNS(&buf[Udphdrsize], len, &reqmsg);


We can find similar codes in dnresolve.c
		len = read(fd, ibuf, Udphdrsize+Maxudp);
		alarm(0);
		len -= Udphdrsize;
		if(len < 0)
			return -1;	/* timed out */
		/* convert into internal format  */
		err = convM2DNS(&ibuf[Udphdrsize], len, mp);

Kenji Arisawa
E-mail: arisawa@aic...