Print this page
10119 audit(1) gets NULL check wrong

*** 21,30 **** --- 21,34 ---- /* * 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,240 **** } 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) { (void) fprintf(stderr, gettext("%s: audit_binfile(5) \"p_dir:\" " "attribute empty\n"), progname); state = B_FALSE; } else if (!contains_valid_dirs(cval_str)) { --- 234,244 ---- } if (strcmp((char *)&(*plugin_kva_ll).plugin_name, "audit_binfile") == 0) { cval_str = kva_match(kvlist, "p_dir"); ! 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)) {