summaryrefslogtreecommitdiff
path: root/media-gfx/epsonscan2/files/0004-Fix-a-crash-on-an-OOB-container-access.patch
blob: 113807dc6b88165a2ea9ec5a1e2f7e8a6f138faf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 6bb06529b7534e7d12179e99e58b3f63a79bfc5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= <hub@figuiere.net>
Date: Sat, 1 Jun 2024 19:43:11 -0400
Subject: [PATCH 4/5] Fix a crash on an OOB container access
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Hubert Figuière <hub@figuiere.net>
---
 src/Controller/Src/Finder/Finder.cpp | 3 +++
 1 file changed, 3 insertions(+)

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