Skip to content

Commit d18170a

Browse files
committed
OVAL/probes: Pass yaml_event_t by reference
Although it's only 104 bytes (ATM) there is no reason to pass it by value.
1 parent 7a15fc1 commit d18170a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/OVAL/probes/independent/yamlfilecontent_probe.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ static bool match_regex(const char *pattern, const char *value)
6767
return false;
6868
}
6969

70-
static SEXP_t *yaml_scalar_event_to_sexp(yaml_event_t event)
70+
static SEXP_t *yaml_scalar_event_to_sexp(yaml_event_t *event)
7171
{
72-
char *tag = (char *) event.data.scalar.tag;
73-
char *value = (char *) event.data.scalar.value;
72+
char *tag = (char *) event->data.scalar.tag;
73+
char *value = (char *) event->data.scalar.value;
7474

7575
/* nodes lacking an explicit tag are given a non-specific tag:
7676
* “!” for non-plain scalars, and “?” for all other nodes
7777
*/
7878
if (tag == NULL) {
79-
if (event.data.scalar.style != YAML_PLAIN_SCALAR_STYLE) {
79+
if (event->data.scalar.style != YAML_PLAIN_SCALAR_STYLE) {
8080
tag = "!";
8181
} else {
8282
tag = "?";
@@ -216,7 +216,7 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
216216
}
217217
}
218218
if (event.type == YAML_SCALAR_EVENT) {
219-
SEXP_t *sexp = yaml_scalar_event_to_sexp(event);
219+
SEXP_t *sexp = yaml_scalar_event_to_sexp(&event);
220220
if (sexp == NULL) {
221221
SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR,
222222
"Can't convert '%s %s' to SEXP", event.data.scalar.tag,

0 commit comments

Comments
 (0)