Skip to content

Commit 95205b0

Browse files
committed
Fix static analysis findings
1 parent 98d3b73 commit 95205b0

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

audisp/plugins/remote/remote-config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ typedef struct remote_conf
4747
unsigned int max_tries_per_record;
4848
unsigned int max_time_per_record;
4949
unsigned int heartbeat_timeout;
50-
const char *krb5_principal;
50+
char *krb5_principal; // gssapi code inserts '@' into the string
5151
const char *krb5_client_name;
5252
const char *krb5_key_file;
5353

auparse/auparse.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,16 +2234,16 @@ static const char *auparse_interpret_sock_parts(auparse_state_t *au,
22342234
if (tmp == NULL)
22352235
return NULL;
22362236
// Locate the address part
2237-
val = strstr(tmp, field);
2238-
if (val) {
2237+
char *aval = strstr(tmp, field);
2238+
if (aval) {
22392239
// Get past the =
2240-
val += strlen(field);
2240+
aval += strlen(field);
22412241
// find other side
2242-
char *ptr = strchr(val, ' ');
2242+
char *ptr = strchr(aval, ' ');
22432243
if (ptr) {
22442244
// terminate, copy, and return it
22452245
*ptr = 0;
2246-
const char *final = strdup(val);
2246+
const char *final = strdup(aval);
22472247
free(tmp);
22482248
free((void *)au->tmp_translation);
22492249
au->tmp_translation = final;

src/auditd-config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct daemon_conf
9090
unsigned long tcp_client_max_port;
9191
unsigned long tcp_client_max_idle;
9292
int transport;
93-
char *krb5_principal; // gssapi code inserts @ sometimes
93+
const char *krb5_principal;
9494
const char *krb5_key_file;
9595
int distribute_network_events;
9696
// Dispatcher config

0 commit comments

Comments
 (0)