Skip to content

Commit

Permalink
Fix 4 static analysis warnings and 2 blank spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
RH-steve-grubb committed Mar 25, 2021
1 parent 16e9558 commit 27e9d40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion audisp/plugins/statsd/audisp-statsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static int audit_fd = -1;
static pid_t auditd_pid = 0;
static auparse_state_t *au = NULL;
static int timer_fd = -1;
static char msg[MAX_AUDIT_MESSAGE_LENGTH];
static char msg[MAX_AUDIT_MESSAGE_LENGTH + 1];
static struct daemon_config d;
static struct audit_report r;

Expand Down Expand Up @@ -148,9 +148,11 @@ static int load_config(void)
break;
default:
fprintf(stderr, "unknown option\n");
close(f);
return 1;
}
}
close(f);
if (status != 0x07) {
fprintf(stderr, "Not all config options specified\n");
return 1;
Expand Down
6 changes: 3 additions & 3 deletions src/ausearch-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,20 +583,20 @@ int check_params(int count, char *vars[])
break;
case S_INFILE:
if (!optarg) {
fprintf(stderr,
fprintf(stderr,
"Argument is required for %s\n",
vars[c]);
retval = -1;
} else {
user_file = strdup(optarg);
user_file = strndup(optarg, PATH_MAX-1);
if (user_file == NULL)
retval = -1;
c++;
}
break;
case S_MESSAGE_TYPE:
if (!optarg) {
fprintf(stderr,
fprintf(stderr,
"Argument is required for %s\n",
vars[c]);
retval = -1;
Expand Down

0 comments on commit 27e9d40

Please sign in to comment.