Skip to content

Commit e2ff4e8

Browse files
CR fixes
1 parent c678c00 commit e2ff4e8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/src/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ impl<'a> Match<'a> {
396396
ScanResultsData::Continuous(scanned_data) => {
397397
scanned_data.as_ref().get(self.inner.range.clone()).unwrap()
398398
}
399-
ScanResultsData::Fragmeneted(sparse_data) => {
399+
ScanResultsData::Fragmented(sparse_data) => {
400400
sparse_data.get(self.inner.range.clone()).unwrap()
401401
}
402402
}

lib/src/scanner/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ impl<'r> Scanner<'r> {
11151115
match func_result {
11161116
Ok(0) => Ok(ScanResults::new(
11171117
self.wasm_store.data(),
1118-
ScanResultsData::Fragmeneted(sparse_scanned_data),
1118+
ScanResultsData::Fragmented(sparse_scanned_data),
11191119
)),
11201120
Ok(v) => panic!("WASM main returned: {}", v),
11211121
Err(err) if err.is::<ScanError>() => {
@@ -1268,7 +1268,7 @@ pub enum ScanResultsData<'a> {
12681268
// overlaps then this is a waste).
12691269
// TODO: if a significant part of the fragment matched then it might be better to just save the
12701270
// whole of it.
1271-
Fragmeneted(FragmentedData),
1271+
Fragmented(FragmentedData),
12721272
}
12731273

12741274
/// Results of a scan operation.

lib/src/scanner/proc/linux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl Mapping {
5757
if (libc::major(dev) != self.dmaj as u32)
5858
|| (libc::minor(dev) != self.dmin as u32)
5959
|| (meta.ino() != self.inode)
60-
|| (meta.size() < self.offset)
60+
|| (meta.size() < (self.offset + self.end - self.begin))
6161
|| ((meta.mode() & libc::S_IFMT) != libc::S_IFREG)
6262
{
6363
return None;
@@ -71,7 +71,7 @@ impl Mapping {
7171
if (libc::major(dev) != self.dmaj as u32)
7272
|| (libc::minor(dev) != self.dmin as u32)
7373
|| (meta.ino() != self.inode)
74-
|| (meta.size() < self.offset)
74+
|| (meta.size() < (self.offset + self.end - self.begin))
7575
|| ((meta.mode() & libc::S_IFMT) != libc::S_IFREG)
7676
{
7777
return None;

0 commit comments

Comments
 (0)