summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Pospisil <Marek.Pospisil@Sun.COM>2010-08-16 16:30:31 -0700
committerMarek Pospisil <Marek.Pospisil@Sun.COM>2010-08-16 16:30:31 -0700
commitaeba2189ca4bd60234ae2e253b2e848decd83f79 (patch)
tree368156645cedbb786049f5379c2be73f75239a58
parent1700d80afc13d34fb120d831601a6c0b77b975bf (diff)
downloadillumos-joyent-aeba2189ca4bd60234ae2e253b2e848decd83f79.tar.gz
6925149 auf_accept() may reference unintialized variable 'fd'
-rw-r--r--usr/src/uts/common/c2/audit_event.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/usr/src/uts/common/c2/audit_event.c b/usr/src/uts/common/c2/audit_event.c
index 85b305c909..81ee3e7f69 100644
--- a/usr/src/uts/common/c2/audit_event.c
+++ b/usr/src/uts/common/c2/audit_event.c
@@ -3549,12 +3549,22 @@ auf_accept(
#else
sy_flags = sysent[scid].sy_flags & SE_RVAL_MASK;
#endif
- if (sy_flags == SE_32RVAL1)
+ switch (sy_flags) {
+ case SE_32RVAL1:
+ /* FALLTHRU */
+ case SE_32RVAL2|SE_32RVAL1:
fd = rval->r_val1;
- if (sy_flags == (SE_32RVAL2|SE_32RVAL1))
- fd = rval->r_val1;
- if (sy_flags == SE_64RVAL)
+ break;
+ case SE_64RVAL:
fd = (int)rval->r_vals;
+ break;
+ default:
+ /*
+ * should never happen, seems to be an internal error
+ * in sysent => no fd, nothing to audit here, returning
+ */
+ return;
+ }
if (error) {
/* can't trust socket contents. Just return */