Skip to content

Commit

Permalink
fix(userspace/libscap): one more source of UB in source_plugin.c
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Sep 4, 2024
1 parent 0a96503 commit bde6e68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion userspace/libscap/engine/source_plugin/source_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static int32_t next(struct scap_engine_handle engine, scap_evt** pevent, uint16_
// Sanity checks in case a plugin implements a non-syscall event source.
// If a plugin has event sourcing capability and has a specific ID, then
// it is allowed to produce only plugin events of its own event source.
uint32_t* pplugin_id = (uint32_t*)((uint8_t*) evt + sizeof(scap_evt) + 4 + 4);
uint8_t* pplugin_id = (uint8_t*) evt + sizeof(scap_evt) + sizeof(uint32_t) + sizeof(uint32_t);
uint32_t plugin_id;
memcpy(&plugin_id, pplugin_id, sizeof(plugin_id));

Expand Down

0 comments on commit bde6e68

Please sign in to comment.