Skip to content

Commit 9c35faf

Browse files
authored
Handle null ETW UserData (#182)
1 parent 976f9f8 commit 9c35faf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

etw-reader/src/etw_types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ impl Deref for EventRecord {
2222

2323
impl EventRecord {
2424
pub(crate) fn user_buffer(&self) -> &[u8] {
25+
if self.UserData == std::ptr::null_mut() {
26+
return &[];
27+
}
2528
unsafe { std::slice::from_raw_parts(self.UserData as *mut _, self.UserDataLength.into()) }
2629
}
2730
}

0 commit comments

Comments
 (0)