Page MenuHome GnuPG

md.c: null pointer passed as an argument to a 'nonnull' parameter
Closed, ResolvedPublic

Description

libtool: compile: /usr/local/bin/scan-build/ccc-analyzer -DHAVE_CONFIG_H -I.
-I.. -I../src -I../src -I/usr/local/include -g3 -O1 -fvisibility=hidden -Wall
-MT md.lo -MD -MP -MF .deps/md.Tpo -c md.c -o md.o

md.c:178:18: warning: Null pointer passed as an argument to a 'nonnull' parameter

if (!stricmp (oid, oid_specs[j].oidstring))
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../src/g10lib.h:282:23: note: expanded from macro 'stricmp'
#define stricmp(a,b) strcasecmp( (a), (b) )

^~~~~~~~~~~~~~~~~~~~~~

md.c:201:7: warning: Null pointer passed as an argument to a 'nonnull' parameter

if (!stricmp (oid, spec->oids[i].oidstring))
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../src/g10lib.h:282:23: note: expanded from macro 'stricmp'
#define stricmp(a,b) strcasecmp( (a), (b) )

^~~~~~~~~~~~~~~~~~~~~~

md.c:315:15: warning: Access to field 'ctx' results in a dereference of a null
pointer (loaded from variable 'hd')

hd->ctx = ctx = (struct gcry_md_context *) ((char *) hd + n);
~~      ^

md.c:487:16: warning: Access to field 'ctx' results in a dereference of a null
pointer (loaded from variable 'bhd')

bhd->ctx = b = (struct gcry_md_context *) ((char *) bhd + n);
~~~      ^

4 warnings generated.

Details

Version
1.6.3

Event Timeline

JW added projects: libgcrypt, Bug Report.
JW added a subscriber: JW.
werner claimed this task.
werner added a project: Mistaken.

No c+p of warnings please! Use gnupg-devel for such things.