Page MenuHome GnuPG

iobuf.c: potential buffer overflows
Closed, ResolvedPublic

Description

/usr/local/bin/scan-build/ccc-analyzer -DHAVE_CONFIG_H -I. -I.. -I../gl
-I../intl -DLOCALEDIR=\"/home/jwalton/gpg-analyze/share/locale\"
-DGNUPG_BINDIR="\"/home/jwalton/gpg-analyze/bin\""
-DGNUPG_LIBEXECDIR="\"/home/jwalton/gpg-analyze/libexec\""
-DGNUPG_LIBDIR="\"/home/jwalton/gpg-analyze/lib/gnupg\""
-DGNUPG_DATADIR="\"/home/jwalton/gpg-analyze/share/gnupg\""
-DGNUPG_SYSCONFDIR="\"/home/jwalton/gpg-analyze/etc/gnupg\""
-DGNUPG_LOCALSTATEDIR="\"/home/jwalton/gpg-analyze/var\""
-I/home/jwalton/gpg-analyze/include -I/usr/local/include
-I/home/jwalton/gpg-analyze/include -I/home/jwalton/gpg-analyze/include
-I/home/jwalton/gpg-analyze/include -DWITHOUT_NPTH=1 -g3 -O1 -Wall
-Wno-pointer-sign -Wpointer-arith -MT libcommon_a-iobuf.o -MD -MP -MF
.deps/libcommon_a-iobuf.Tpo -c -o libcommon_a-iobuf.o `test -f 'iobuf.c' || echo
'./'`iobuf.c

iobuf.c:602:7: warning: Value stored to 'f' is never read

f = GNUPG_INVALID_FD;
^   ~~~~~~~~~~~~~~~~

iobuf.c:617:3: warning: Assigned value is garbage or undefined

size_t size = *ret_len;
^~~~~~~~~~~   ~~~~~~~~

iobuf.c:1325:3: warning: String copy function overflows destination buffer

strcpy (fcx->fname, fname);
^~~~~~~~~~~~~~~~~~~~~~~~~~

iobuf.c:1461:3: warning: String copy function overflows destination buffer

strcpy (fcx->fname, fname);
^~~~~~~~~~~~~~~~~~~~~~~~~~

4 warnings generated.

Details

Version
2.1.2

Event Timeline

JW set Version to 2.1.2.
JW added a subscriber: JW.

Please stop using this severely broken analyzer. It does not overflow anything.
Checkout the allocation of the bufgfger 3 lines earlier!

werner claimed this task.