[Bug 229665] src/sys/netpfil/ipfw/ip_fw_sockopt.c:304: possible bad size in malloc ?

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Jul 10 06:50:35 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229665

            Bug ID: 229665
           Summary: src/sys/netpfil/ipfw/ip_fw_sockopt.c:304: possible bad
                    size in malloc ?
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: dcb314 at hotmail.com

src/sys/netpfil/ipfw/ip_fw_sockopt.c:304]: (warning) Size of pointer 'idxmap'
used instead of size of its data.

Source code is

        int *idxmap, *idxmap_back;

        idxmap = malloc(65536 * sizeof(uint32_t *), M_IPFW,
            M_WAITOK | M_ZERO);
        idxmap_back = malloc(65536 * sizeof(uint32_t *), M_IPFW,
            M_WAITOK | M_ZERO);

maybe better code

        int *idxmap, *idxmap_back;

        idxmap = malloc(65536 * sizeof(int), M_IPFW,
            M_WAITOK | M_ZERO);
        idxmap_back = malloc(65536 * sizeof(int), M_IPFW,
            M_WAITOK | M_ZERO);

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list