Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Mar 1998 18:54:08 -0600
From:      Steve Price <sprice@hiwaay.net>
To:        Justin Kalina <justin@ad-v.com>
Cc:        bugs@FreeBSD.ORG
Subject:   Re: core dump "host -l"
Message-ID:  <34FA0330.7A5F06AF@hiwaay.net>
References:  <Pine.BSF.3.96.980301161827.7533A-100000@luptid.ad-v.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Justin Kalina wrote:
> 
> host seems to seg. fault and dump core using diffrent variations of the
> code.
> 
> bash$ host -l NS luptid.ad-v.com
> Using domain server:
> Name: luptid.ad-v.com
> Address: 209.51.160.70
> Aliases:
> 
> Server failed: Premature end of data
> Segmentation fault (core dumped)

It seems the server's response is of a length that is too
large and the stack is getting corrupted.  Attached is a
patch that circumvents the problem but should by no means
be considered the correct fix.

Steve

>                         Justin
> 
> ---------------------------------------------------------------------------
> Justin Kalina                                           justin@ad-v.com
> Adamantine Ventures, Inc.                               Vice President
> http://www.ad-v.com                                     973-989-8213
> ----------------------------------------------------------------------------

Index: host.c
===================================================================
RCS file: /u/FreeBSD/cvs/src/contrib/bind/tools/host.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 host.c
--- host.c	1996/12/31 19:51:05	1.1.1.2
+++ host.c	1998/03/01 23:24:42
@@ -1345,6 +1345,11 @@
 	     * Read the response.
 	     */
 
+	    if (len > sizeof(buf)) {
+		    printf("Server returned invalid length: %d\n", len);
+		    return (SUCCESS);
+	    }
+
 	    amtToRead = len;
 	    cp = (u_char *) &buf;
 	    while(amtToRead > 0 && (numRead = read(sockFD, cp, amtToRead)) >
0){

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34FA0330.7A5F06AF>