Projects
Mega:24.03:SP1:Everything
sane-backends
_service:tar_scm:Add-check-for-ports-to-avoid-S...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:Add-check-for-ports-to-avoid-Segmentation-fault.patch of Package sane-backends
From d7bd15792ea3d2613aa5a0b09d948dc2ef77dfcf Mon Sep 17 00:00:00 2001 From: lingsheng <lingsheng@huawei.com> Date: Wed, 27 Jan 2021 15:00:32 +0800 Subject: [PATCH] Add check for ports to avoid Segmentation fault --- tools/umax_pp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/umax_pp.c b/tools/umax_pp.c index 7b127e3..00ffea9 100644 --- a/tools/umax_pp.c +++ b/tools/umax_pp.c @@ -355,12 +355,15 @@ main (int argc, char **argv) if (rc != 1) { ports = sanei_parport_find_port (); - i = 0; - rc = 0; - while ((ports[i] != NULL) && (rc != 1)) + if (ports != NULL) { - rc = sanei_umax_pp_initPort (strtol (ports[i], NULL, 16), NULL); - i++; + i = 0; + rc = 0; + while ((ports[i] != NULL) && (rc != 1)) + { + rc = sanei_umax_pp_initPort (strtol (ports[i], NULL, 16), NULL); + i++; + } } } if (rc != 1) -- 2.23.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2