Skip to content

Commit ffba4b9

Browse files
committed
Fix warning message
The parameter `arg` is of type `struct probe_common_main_argument *` and should not be typecast to `char *`. To get the probe name, we need to access the subtype variable and convert it to string.
1 parent e299045 commit ffba4b9

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

src/OVAL/probes/probe/input_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void *probe_input_handler(void *arg)
124124
SEXP_VALIDATE(oid);
125125

126126
if (probe->offline_mode && probe->supported_offline_mode == PROBE_OFFLINE_NONE) {
127-
dW("Requested offline mode is not supported by %s.", probe->name);
127+
dW("Requested offline mode is not supported by %s probe.", oval_subtype_get_text(probe->subtype));
128128
/* Return a dummy. */
129129
probe_out = probe_cobj_new(SYSCHAR_FLAG_NOT_APPLICABLE, NULL, NULL, NULL);
130130
probe_ret = 0;

src/OVAL/probes/probe/probe.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ typedef struct {
4747
pthread_rwlock_t rwlock;
4848
uint32_t flags;
4949

50-
char *name;
5150
pid_t pid;
5251

5352
void *probe_arg;

src/OVAL/probes/probe/probe_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ static void probe_common_main_cleanup(void *arg)
158158
rbt_i32_free(probe->workers);
159159
SEAP_CTX_free(probe->SEAP_ctx);
160160
free(probe->option);
161-
free(probe->name);
162161

163162
dD("probe_common_main_cleanup finished");
164163
}
@@ -193,7 +192,6 @@ void *probe_common_main(void *arg)
193192
probe.selected_offline_mode = PROBE_OFFLINE_NONE;
194193
probe.flags = 0;
195194
probe.pid = getpid();
196-
probe.name = (char *) arg;
197195
probe.probe_exitcode = 0;
198196

199197
/*

0 commit comments

Comments
 (0)