Print this page
10119 audit(1) gets NULL check wrong
@@ -21,10 +21,14 @@
/*
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
+
#include <fcntl.h>
#include <libscf.h>
#include <secdb.h>
#include <stdlib.h>
#include <stdio.h>
@@ -230,11 +234,11 @@
}
if (strcmp((char *)&(*plugin_kva_ll).plugin_name,
"audit_binfile") == 0) {
cval_str = kva_match(kvlist, "p_dir");
- if (*cval_str == '\0' || cval_str == NULL) {
+ if (cval_str == NULL || cval_str[0] == '\0') {
(void) fprintf(stderr,
gettext("%s: audit_binfile(5) \"p_dir:\" "
"attribute empty\n"), progname);
state = B_FALSE;
} else if (!contains_valid_dirs(cval_str)) {