From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 27 02:00:37 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09E5C16A416 for ; Fri, 27 Oct 2006 02:00:37 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B20343D45 for ; Fri, 27 Oct 2006 02:00:36 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k9R20aQh046495 for ; Fri, 27 Oct 2006 02:00:36 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k9R20aGW046494; Fri, 27 Oct 2006 02:00:36 GMT (envelope-from gnats) Resent-Date: Fri, 27 Oct 2006 02:00:36 GMT Resent-Message-Id: <200610270200.k9R20aGW046494@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ryoji Kanai Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2DDE16A415 for ; Fri, 27 Oct 2006 01:51:29 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC6EE43D58 for ; Fri, 27 Oct 2006 01:51:29 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k9R1pM03011669 for ; Fri, 27 Oct 2006 01:51:22 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k9R1pMb4011645; Fri, 27 Oct 2006 01:51:22 GMT (envelope-from nobody) Message-Id: <200610270151.k9R1pMb4011645@www.freebsd.org> Date: Fri, 27 Oct 2006 01:51:22 GMT From: Ryoji Kanai To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: bin/104845: Build error on contrib/file/magic X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2006 02:00:37 -0000 >Number: 104845 >Category: bin >Synopsis: Build error on contrib/file/magic >Confidential: no >Severity: non-critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 27 02:00:35 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Ryoji Kanai >Release: 7.0-Current >Organization: - >Environment: FreeBSD unicorn 7.0-CURRENT FreeBSD 7.0-CURRENT #7: Fri May 26 23:01:24 PDT 2006 kanai@unicorn:/usr/obj/usr/src/sys/UNICORN i386 >Description: I can't build libmagic due to a bug in "magic" program. It seems to be a overflow type bug and I always got a segmentation fault when I'm doing "make buildworld". The problem is in contrib/file/apprentice.c. >How-To-Repeat: make buildworld That's it. You should get a Segmentation fault. Is this only me? >Fix: I GDBed the magic program and found this. I'm not sure this is the right way to fix it. angelfish:file> diff -u apprentice.c.orig apprentice.c --- apprentice.c.orig Thu Oct 26 10:48:19 2006 +++ apprentice.c Thu Oct 26 11:34:31 2006 @@ -894,6 +894,7 @@ m->nospflag = 0; while ((m->desc[i++] = *l++) != '\0' && i < MAXDESC) /* NULLBODY */; + m->desc[MAXDESC - 1] = 0; if (ms->flags & MAGIC_CHECK) { if (!check_format(ms, m)) >Release-Note: >Audit-Trail: >Unformatted: