Date: Thu, 17 Aug 2017 17:13:15 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322624 - stable/11/usr.bin/grep/regex Message-ID: <201708171713.v7HHDFF4039586@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Thu Aug 17 17:13:15 2017 New Revision: 322624 URL: https://svnweb.freebsd.org/changeset/base/322624 Log: MFC r318916: bsdgrep: use safer sizeof() construct Approved by: emaste (mentor, blanket MFC) Modified: stable/11/usr.bin/grep/regex/tre-fastmatch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- stable/11/usr.bin/grep/regex/tre-fastmatch.c Thu Aug 17 17:11:59 2017 (r322623) +++ stable/11/usr.bin/grep/regex/tre-fastmatch.c Thu Aug 17 17:13:15 2017 (r322624) @@ -351,7 +351,7 @@ static int fastcmp(const fastmatch_t *fg, const void * #define FILL_BMGS \ if (fg->len > 0 && !fg->hasdot) \ { \ - fg->sbmGs = malloc(fg->len * sizeof(int)); \ + fg->sbmGs = malloc(fg->len * sizeof(*fg->sbmGs)); \ if (!fg->sbmGs) \ return REG_ESPACE; \ if (fg->len == 1) \ @@ -367,7 +367,7 @@ static int fastcmp(const fastmatch_t *fg, const void * #define FILL_BMGS_WIDE \ if (fg->wlen > 0 && !fg->hasdot) \ { \ - fg->bmGs = malloc(fg->wlen * sizeof(int)); \ + fg->bmGs = malloc(fg->wlen * sizeof(*fg->bmGs)); \ if (!fg->bmGs) \ return REG_ESPACE; \ if (fg->wlen == 1) \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708171713.v7HHDFF4039586>