We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5ce06a commit 6f3bdabCopy full SHA for 6f3bdab
src/pe/tls.rs
@@ -227,7 +227,15 @@ impl<'a> TlsData<'a> {
227
rva
228
))
229
})?;
230
- if offset + size as usize > bytes.len() {
+
231
+ let offset_end = offset.checked_add(size as usize).ok_or_else(|| {
232
+ error::Error::Malformed(format!(
233
+ "tls start_address_of_raw_data ({:#x}) + size_of_raw_data ({:#x}) casues an integer overflow",
234
+ offset, size
235
+ ))
236
+ })?;
237
238
+ if offset > bytes.len() || offset_end > bytes.len() {
239
return Err(error::Error::Malformed(format!(
240
"tls raw data offset ({:#x}) and size ({:#x}) greater than byte slice len ({:#x})",
241
offset, size, bytes.len()
0 commit comments