Skip to content

Commit 37fd155

Browse files
authored
Merge pull request #1491 from evgenyz/fix_lgtm_warnings
Fix LGTM warnings
2 parents e81d32f + 73fefff commit 37fd155

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

src/CPE/cpename.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,8 @@ struct cpe_name *cpe_name_new(const char *cpestr)
303303

304304
free(data_);
305305
free(fields_);
306-
}
307-
else if (format == CPE_FORMAT_WFN)
308-
{
306+
} else if (format == CPE_FORMAT_WFN) {
307+
/* FIXME: Do something here or remove the branch */
309308
}
310309
}
311310
return cpe;

src/OVAL/probes/SEAP/sexp-value.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ uintptr_t SEXP_rawval_lblk_copy (uintptr_t lblkp, uint16_t n_skip)
489489
/*
490490
* copy list items
491491
*/
492-
while (off_n < (1 << cur_sz) && off_o < lb_old->real) {
492+
while (off_n < ((uint16_t)1 << cur_sz) && off_o < lb_old->real) {
493493
lb_new->memb[off_n].s_valp = SEXP_rawval_incref (lb_old->memb[off_o].s_valp);
494494
lb_new->memb[off_n].s_type = lb_old->memb[off_o].s_type;
495495
#if !defined(NDEBUG) || defined(VALIDATE_SEXP)

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,

src/OVAL/probes/unix/gconf_probe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ int gconf_probe_main(probe_ctx *ctx, void *probe_arg)
222222
collect_item_direct(ctx, gconf_addr, gconf_engine, gconf_key);
223223
break;
224224
case OVAL_OPERATION_PATTERN_MATCH:
225+
/* FIXME: This is a NOOP call */
225226
collect_item_regexp(ctx, gconf_addr, gconf_engine, gconf_key);
226227
break;
227228
default:
@@ -249,6 +250,7 @@ int gconf_probe_main(probe_ctx *ctx, void *probe_arg)
249250
collect_item_direct(ctx, NULL, gconf_engine, gconf_key);
250251
break;
251252
case OVAL_OPERATION_PATTERN_MATCH:
253+
/* FIXME: This is a NOOP call */
252254
collect_item_regexp(ctx, NULL, gconf_engine, gconf_key);
253255
break;
254256
default:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static int get_rpminfo(struct rpminfo_req *req, struct rpminfo_rep **rep, struct
177177
regex_t keyid_regex;
178178

179179
if (regcomp(&keyid_regex, g_keyid_regex_string, REG_EXTENDED) != 0) {
180-
dE("regcomp(%s) failed.");
180+
dE("regcomp(%s) failed.", g_keyid_regex_string);
181181
return -1;
182182
}
183183

src/OVAL/probes/unix/linux/systemdshared.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ static char *dbus_value_to_string(DBusMessageIter *iter)
261261

262262
#ifdef DBUS_HAVE_INT64
263263
case DBUS_TYPE_INT64:
264-
return oscap_sprintf("%lli", value.i32);
264+
return oscap_sprintf("%lli", value.i64);
265265

266266
case DBUS_TYPE_UINT64:
267-
return oscap_sprintf("%llu", value.u32);
267+
return oscap_sprintf("%llu", value.u64);
268268
#endif
269269

270270
case DBUS_TYPE_DOUBLE:

utils/oscap-tool.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
* Maros Barabas <[email protected]>
2121
*/
2222

23+
#pragma once
24+
#ifndef OSCAP_TOOL_H_
25+
#define OSCAP_TOOL_H_
2326

2427
/* Standard header files */
2528
#include <stdio.h>
@@ -224,3 +227,5 @@ getopt_long(int ___argc, char *__getopt_argv_const *___argv,
224227
const struct option *__longopts, int *__longind);
225228

226229
#endif
230+
231+
#endif //OSCAP_TOOL_H_

0 commit comments

Comments
 (0)