Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 2015 22:11:30 +0100
From:      Dirk Engling <erdgeist@erdgeist.org>
To:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   zero size memset
Message-ID:  <54C16782.2010307@erdgeist.org>

next in thread | raw e-mail | index | archive | help
Dear fellow hackers,

knowing that the memset API tends to be hard to remember from time to
time, I grepped the FreeBSD source for occurences of memset with a
length parameter of 0 and a character parameter that should have been a
length and found the following:

./contrib/gdb/gdb/remote.c:    memset (regs, rs->sizeof_g_packet, 0);
./contrib/gdb/gdb/std-regs.c:  memset (buf, TYPE_LENGTH (VALUE_TYPE
(val)), 0);
./contrib/gdb/gdb/std-regs.c:   memset (buf, TYPE_LENGTH (VALUE_TYPE
(val)), 0);
./contrib/gdb/gdb/std-regs.c:   memset (buf, TYPE_LENGTH (VALUE_TYPE
(val)), 0);

Whom to nudge to have this fixed?

I also grepped the tree for occurences of x = realloc(x ... but found
too many of them to check all instances if they properly abort() when x
is NULL. Does anyone know how to exclude false positives here?

TIA,

  erdgeist



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