From owner-freebsd-bugs Fri Mar 29 19:20:15 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 107D437B41C for ; Fri, 29 Mar 2002 19:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2U3K0p07742; Fri, 29 Mar 2002 19:20:00 -0800 (PST) (envelope-from gnats) Received: from mailout10.sul.t-online.com (mailout10.sul.t-online.com [194.25.134.21]) by hub.freebsd.org (Postfix) with ESMTP id 4774937B405 for ; Fri, 29 Mar 2002 19:18:48 -0800 (PST) Received: from fwd03.sul.t-online.de by mailout10.sul.t-online.com with smtp id 16r9OB-0004QK-01; Sat, 30 Mar 2002 04:18:47 +0100 Received: from spirit.zuhause.stoert.net (320050403952-0001@[217.82.55.8]) by fmrl03.sul.t-online.com with esmtp id 16r9Nw-183LUWC; Sat, 30 Mar 2002 04:18:32 +0100 Received: from elevation.zuhause.stoert.net (elevation.zuhause.stoert.net [192.168.66.46]) by spirit.zuhause.stoert.net (8.11.6/8.11.6) with ESMTP id g2U3IVR52651 for ; Sat, 30 Mar 2002 04:18:31 +0100 (CET) (envelope-from corecode@corecode.ath.cx) Received: (from corecode@localhost) by elevation.zuhause.stoert.net (8.11.6/8.11.6) id g2U3ITw38627; Sat, 30 Mar 2002 04:18:29 +0100 (CET) (envelope-from corecode) Message-Id: <200203300318.g2U3ITw38627@elevation.zuhause.stoert.net> Date: Sat, 30 Mar 2002 04:18:29 +0100 (CET) From: "Simon 'corecode' Schubert" Reply-To: "Simon 'corecode' Schubert" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/36521: find segfaults when called without command in -exec Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 36521 >Category: bin >Synopsis: find segfaults when called without command in -exec >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 29 19:20:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Simon 'corecode' Schubert >Release: FreeBSD 4.5-STABLE i386 >Organization: >Environment: System: FreeBSD elevation.zuhause.stoert.net 4.5-STABLE FreeBSD 4.5-STABLE #0: Fri Mar 22 19:08:08 CET 2002 corecode@elevation.zuhause.stoert.net:/usr/obj/i386/k7/usr/src/sys/ELEVATION i386 >Description: doing a find -exec ';' results in a segfault for each found file this is because this case isn't checked for and execvp gets a NULL parameter >How-To-Repeat: find . -exec ';' # look at syslog >Fix: maybe some kind of this: note! this patch was not checked, no guarantee this will compile, neither work! just to give the idea what is needed --- /usr/src/usr.bin/find/function.c Wed Oct 3 12:09:29 2001 +++ function.c Sat Mar 30 04:12:56 2002 @@ -514,6 +514,9 @@ break; } + if (ap == *argvp) + errx(1, "%s: no command given", option->name); + cnt = ap - *argvp + 1; new->e_argv = (char **)emalloc((u_int)cnt * sizeof(char *)); new->e_orig = (char **)emalloc((u_int)cnt * sizeof(char *)); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message