summarylogtreecommitdiffstats
path: root/epsonscan2-oob-container.patch
blob: f805363ea4d5b7a4225c31a59628b2588de5e9d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
commit 7e42ca6214a7f3b177b250a8e93b1230f1190f42
Author: Hubert Figuière <hub@figuiere.net>
Date:   Fri Oct 28 11:38:24 2022 -0400

    Fix out of bound access on empty container

diff --git a/src/Controller/Src/Finder/Finder.cpp b/src/Controller/Src/Finder/Finder.cpp
index 8e24f2f..13039cf 100644
--- a/src/Controller/Src/Finder/Finder.cpp
+++ b/src/Controller/Src/Finder/Finder.cpp
@@ -38,6 +38,9 @@ namespace epsonscan {
 		}
 		SDIDeviceInfo* Finder::GetDevicesPointer()
 		{
+			if (devices_.size() == 0) {
+				return nullptr;
+			}
 			return &devices_[0];
 		}