Date: Sun, 16 Apr 2017 01:15:38 +0000 (UTC) From: Cy Schubert <cy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316994 - head/contrib/ipfilter/tools Message-ID: <201704160115.v3G1FcL3028510@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cy Date: Sun Apr 16 01:15:37 2017 New Revision: 316994 URL: https://svnweb.freebsd.org/changeset/base/316994 Log: Fix CID 1372600, possible NULL pointer dereference should reallocarray() fail. Reported by: Coverity CID 1372600 MFC after: 1 week Modified: head/contrib/ipfilter/tools/ipf_y.y Modified: head/contrib/ipfilter/tools/ipf_y.y ============================================================================== --- head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 01:13:47 2017 (r316993) +++ head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 01:15:37 2017 (r316994) @@ -2195,6 +2195,10 @@ char *phrase; for (i = 0, s = strtok(phrase, " \r\n\t"); s != NULL; s = strtok(NULL, " \r\n\t"), i++) { fb = reallocarray(fb, i / 4 + 1, sizeof(*fb)); + if (fb == NULL) { + perror("memory allocation error at __LINE__ in __FUNCTION__ in __FILE"); + abort(); + } l = (u_32_t)strtol(s, NULL, 0); switch (i & 3) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704160115.v3G1FcL3028510>