Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Mar 2002 20:16:39 -0800 (PST)
From:      nobody <nobody@nobody.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/35700: a small code update
Message-ID:  <200203090416.g294Gde94327@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203090416.g294Gde94327>