diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-11-19 21:07:25 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-11-19 21:07:25 +0100 |
| commit | edf2395b199da9e971e8232ffe82f1ffb4a81c29 (patch) | |
| tree | 22bb339a3f09006d2d29bd6a328725b07b1d5550 /src/lib/cross_common.cc | |
| parent | 2603a529a05905f133bd52271fb1298e9a4a4aa5 (diff) | |
Fix out-of-bounds read in OSX disk checking (#2658).
Diffstat (limited to 'src/lib/cross_common.cc')
| -rw-r--r-- | src/lib/cross_common.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/cross_common.cc b/src/lib/cross_common.cc index e8c209b21..b4d322096 100644 --- a/src/lib/cross_common.cc +++ b/src/lib/cross_common.cc @@ -172,7 +172,7 @@ osx_disks_to_drives (vector<OSXDisk> disks) continue; } for (auto& j: disks) { - if (!j.mount_points.empty() && starts_with(j.device, i.device)) { + if (&i != &j && !j.mount_points.empty() && starts_with(j.device, i.device)) { LOG_DISK("Marking %1 as mounted because %2 is", i.device, j.device); std::copy(j.mount_points.begin(), j.mount_points.end(), back_inserter(i.mount_points)); } |
