Fix unchecked calls to asprintf
authorJeffrey Hutzelman <jhutz@cmu.edu>
Sat, 15 Jun 2013 22:58:13 +0000 (18:58 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 1 Dec 2014 16:27:15 +0000 (11:27 -0500)
commitd527a8082507bf091f89c7964ce152dfce5d4052
tree201b8291f3857460cadd7288bec1ca1e4d63823b
parent13c1684b59d5780e205f451da1a7d7f61f5ce78d
Fix unchecked calls to asprintf

The return value of asprintf() is the number of bytes printed, or -1 if there
was an error allocating a large enough buffer.  In the latter case, the value
of the result string is undefined, and so it cannot be counted on to be NULL.

This change fixes numerous places where the result of asprintf is checked
incorrectly (by examining the output pointer and not the return value) or not
at all.

Change-Id: I9fef14d60c096795d59c42798f3906041fb18c86
Reviewed-on: http://gerrit.openafs.org/9978
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
21 files changed:
src/afsd/afsd_fuse.c
src/afsweb/apache_afs_plugin.c
src/aklog/aklog.c
src/audit/audit-file.c
src/auth/cellconfig.c
src/bozo/bnode.c
src/bozo/bosoprocs.c
src/bozo/bosserver.c
src/budb/procs.c
src/budb/server.c
src/cmd/cmd.c
src/kauth/krb_tf.c
src/platform/DARWIN/AklogAuthPlugin/aklog.c
src/ptserver/db_verify.c
src/ptserver/ptutils.c
src/sys/rmtsysc.c
src/tests/create-stat.c
src/util/dirpath.c
tests/cmd/command-t.c
tests/common/servers.c
tests/volser/vos-t.c