From owner-freebsd-current@FreeBSD.ORG Sun Dec 16 18:55:24 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5155016A41A for ; Sun, 16 Dec 2007 18:55:24 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.freebsd.org (Postfix) with ESMTP id 9BF7E13C46A for ; Sun, 16 Dec 2007 18:55:23 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost.int.ru [127.0.0.1] (may be forged)) by mp2.macomnet.net (8.13.7/8.13.8) with ESMTP id lBGIRHdx025523 for ; Sun, 16 Dec 2007 21:27:17 +0300 (MSK) (envelope-from maxim@macomnet.ru) Date: Sun, 16 Dec 2007 21:27:17 +0300 (MSK) From: Maxim Konovalov To: current@freebsd.org Message-ID: <20071216211832.X83419@mp2.macomnet.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Subject: route(8) core dump, possible gcc(1) related X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2007 18:55:24 -0000 Hello, gcc w/ default flags: # route add 172.19.16.0.0/16 10.10.10.2 zsh: segmentation fault (core dumped) gcc -O0: # route add 172.19.16.0.0/16 10.10.10.2 route: bad address: 172.19.16.0.0/16 I failed to find any bugs in this code snippet where route(8) dumps a core (line 1041): 1033 q = strchr(s,'/'); 1034 if (q && which == RTA_DST) { 1035 *q = '\0'; 1036 if ((val = inet_network(s)) != INADDR_NONE) { 1037 inet_makenetandmask( 1038 val, &su->sin, strtoul(q+1, 0, 0)); 1039 return (0); 1040 } 1041 *q = '/'; 1042 } Any comments? -- Maxim Konovalov