Skip to content

Commit

Permalink
events: do not read garbage memory on empty control files
Browse files Browse the repository at this point in the history
  • Loading branch information
pkova authored Oct 3, 2024
1 parent f5799a9 commit 174f35b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/noun/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ _ce_patch_read_control(u3_ce_patch* pat_u)
len_w = (c3_w) buf_u.st_size;
}

if (0 == len_w) {
return c3n;
}

pat_u->con_u = c3_malloc(len_w);
if ( (len_w != read(pat_u->ctl_i, pat_u->con_u, len_w)) ||
(len_w != sizeof(u3e_control) +
Expand Down

0 comments on commit 174f35b

Please sign in to comment.