Skip to content

Commit 8ad4fdd

Browse files
committed
Merge branch 'maint-1.2'
Conflicts: src/OVAL/probes/unix/linux/iflisteners_probe.c
2 parents 21dc3cd + b1bf58f commit 8ad4fdd

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/CVRF/cvrf_priv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,14 +515,14 @@ struct cvrf_vulnerability *cvrf_vulnerability_clone(const struct cvrf_vulnerabil
515515
}
516516

517517
int cvrf_vulnerability_filter_by_product(struct cvrf_vulnerability *vuln, const char *prod) {
518-
struct oscap_stringlist *filtered_ids = oscap_stringlist_new();
519518
int ret = 0;
520519

521520
struct cvrf_product_status_iterator *statuses = cvrf_vulnerability_get_product_statuses(vuln);
522521
while (cvrf_product_status_iterator_has_more(statuses)) {
523522
struct cvrf_product_status *stat = cvrf_product_status_iterator_next(statuses);
524523

525524
struct oscap_string_iterator *products = cvrf_product_status_get_ids(stat);
525+
struct oscap_stringlist *filtered_ids = oscap_stringlist_new();
526526
while (oscap_string_iterator_has_more(products)) {
527527
const char *product_id = oscap_string_iterator_next(products);
528528
if (oscap_str_startswith(product_id, prod))

src/OVAL/probes/independent/textfilecontent54_probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static int process_file(const char *prefix, const char *path, const char *file,
180180
struct pfdata *pfd = (struct pfdata *) arg;
181181
int ret = 0, path_len, file_len, cur_inst = 0, fd = -1, substr_cnt,
182182
buf_size = 0, buf_used = 0, ofs = 0, buf_inc = 4096;
183+
char **substrs = NULL;
183184
char *whole_path = NULL, *whole_path_with_prefix = NULL, *buf = NULL;
184185
SEXP_t *next_inst = NULL;
185186
struct stat st;
@@ -249,7 +250,6 @@ static int process_file(const char *prefix, const char *path, const char *file,
249250
buf[buf_used++] = '\0';
250251

251252
do {
252-
char **substrs;
253253
int want_instance;
254254

255255
next_inst = SEXP_number_newi_32(cur_inst + 1);

src/OVAL/probes/independent/textfilecontent_probe.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ static SEXP_t *create_item(const char *path, const char *filename, char *pattern
171171
"text", OVAL_DATATYPE_STRING, substrs[0],
172172
NULL);
173173

174+
SEXP_string_free(se_filepath);
175+
SEXP_string_free(se_instance);
176+
174177
for (i = 1; i < substr_cnt; ++i) {
175178
probe_item_ent_add (item, "subexpression", NULL, r0 = SEXP_string_new (substrs[i], strlen (substrs[i])));
176179
SEXP_free (r0);
@@ -192,6 +195,8 @@ static int process_file(const char *prefix, const char *path, const char *filena
192195
char *whole_path = NULL, *whole_path_with_prefix = NULL;
193196
FILE *fp = NULL;
194197
struct stat st;
198+
char **substrs = NULL;
199+
int substr_cnt = 0;
195200

196201
// todo: move to probe_main()?
197202
int erroffset = -1;
@@ -241,9 +246,6 @@ static int process_file(const char *prefix, const char *path, const char *filena
241246
char line[4096];
242247

243248
while (fgets(line, sizeof(line), fp) != NULL) {
244-
char **substrs;
245-
int substr_cnt;
246-
247249
substr_cnt = get_substrings(line, re, 1, &substrs);
248250
if (substr_cnt > 0) {
249251
int k;

src/OVAL/probes/unix/linux/iflisteners_probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int get_interface(const int ent_ifindex, struct interface_t *interface) {
352352
}
353353
else {
354354
int buf_len;
355-
if (fscanf(fd, "%s\n", buf) < 1)
355+
if (fscanf(fd, "%254s\n", buf) < 1)
356356
*buf = '\0';
357357

358358
buf_len = strlen(buf);

0 commit comments

Comments
 (0)