Skip to content

Commit

Permalink
Merge pull request #2034 from 0intro/coverity-out-of-bounds-access-20…
Browse files Browse the repository at this point in the history
…230920

Fix out-of-bounds access reported by Coverity
  • Loading branch information
jan-cerny authored Sep 25, 2023
2 parents 1d5dfe1 + c9cd9c1 commit d29ef10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/OVAL/probes/probe/worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ static int probe_varref_create_ctx(const SEXP_t *probe_in, SEXP_t *varrefs, stru
ent_cnt = SEXP_number_getu_32(r1 = SEXP_list_nth(varrefs, 3));
SEXP_free(r1);

if (ent_cnt == UINT32_MAX)
return -1;

struct probe_varref_ctx *ctx = malloc(sizeof(struct probe_varref_ctx));
ctx->pi2 = SEXP_softref((SEXP_t *)probe_in);
ctx->ent_cnt = ent_cnt;
Expand Down

0 comments on commit d29ef10

Please sign in to comment.