From feb2056866ae9c9d74468022d2113c77752cffb1 Mon Sep 17 00:00:00 2001 From: ut-MobeiSiran <73693275+ut-MobeiSiran@users.noreply.github.com> Date: Wed, 24 Mar 2021 16:56:47 +0800 Subject: [PATCH] Fix crashes with SEGV in scan_device It should return false when the path does not exist, instead of continuing. --- src/core/parisc.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/parisc.cc b/src/core/parisc.cc index 1e531e32..d6f860c0 100644 --- a/src/core/parisc.cc +++ b/src/core/parisc.cc @@ -520,6 +520,9 @@ static hwNode get_device(long hw_type, long sversion, long hversion) static bool scan_device(hwNode & node, string name = "") { + if(!exists(name)) + return false; + struct dirent **namelist; int n; hwNode * curnode = NULL;