From owner-freebsd-bugs Fri Mar 8 20:22:43 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 AF4F237B404 for ; Fri, 8 Mar 2002 20:21:20 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g294LKJ97510; Fri, 8 Mar 2002 20:21:20 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 45F1937B400 for ; Fri, 8 Mar 2002 20:16:39 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g294Gde94327; Fri, 8 Mar 2002 20:16:39 -0800 (PST) (envelope-from nobody) Message-Id: <200203090416.g294Gde94327@freefall.freebsd.org> Date: Fri, 8 Mar 2002 20:16:39 -0800 (PST) From: nobody To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/35700: a small code update 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: 35700 >Category: kern >Synopsis: a small code update >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 08 20:20:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: nobody >Release: 4.5 >Organization: nobody.com >Environment: FreeBSD bsd 4.5-STABLE FreeBSD 4.5-STABLE #11: Tue Jan 29 20:22:14 PST 2002 root@bsd:/usr/src/sys/compile/MYKERN i386 >Description: found a minor bug in the bpf code. Unified diff included: # more /tmp/bpfdiffs --- /usr/src/sys/net/bpfold.c Fri Mar 8 17:18:45 2002 +++ /usr/src/sys/net/bpf.c Fri Mar 8 17:26:01 2002 @@ -990,7 +990,9 @@ return (EINVAL); size = flen * sizeof(*fp->bf_insns); - fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK); + if((fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK)) == NULL) + return (EINVAL); + if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) == 0 && bpf_validate(fcode, (int)flen)) { s = splimp(); >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message