diff options
author | pjd <pjd@FreeBSD.org> | 2005-03-22 22:05:44 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-03-22 22:05:44 +0000 |
commit | 26774156e715664e073c718c5a85ccdff1137db4 (patch) | |
tree | 5a272093a51ffb00a0a1790e507ab56de5cee30b /sbin/geom/core | |
parent | 73fde55ff0c91df3dda76adfc568d9dbbfd30387 (diff) | |
download | FreeBSD-src-26774156e715664e073c718c5a85ccdff1137db4.zip FreeBSD-src-26774156e715664e073c718c5a85ccdff1137db4.tar.gz |
Fix use of uninitialized buf[0].
Reported by: stefanf
MFC after: 3 days
Diffstat (limited to 'sbin/geom/core')
-rw-r--r-- | sbin/geom/core/geom.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index ea28819..c25157c 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -425,6 +425,7 @@ run_command(int argc, char *argv[]) gctl_ro_param(req, "version", sizeof(*version), version); parse_arguments(cmd, req, &argc, &argv); + bzero(buf, sizeof(buf)); if (cmd->gc_func != NULL) { unsigned flags; @@ -432,7 +433,6 @@ run_command(int argc, char *argv[]) cmd->gc_func(req, flags); errstr = req->error; } else { - bzero(buf, sizeof(buf)); gctl_rw_param(req, "output", sizeof(buf), buf); errstr = gctl_issue(req); } @@ -443,7 +443,7 @@ run_command(int argc, char *argv[]) exit(EXIT_FAILURE); } } - if (*buf != '\0') + if (buf[0] != '\0') printf("%s", buf); gctl_free(req); if (verbose) |