From e94622c319e4307617b202f19d3ec05b21a9bb49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 27 Sep 2015 08:20:20 +0200 Subject: merge to 1.0.25+git20150927 --- backend/artec_eplus48u.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'backend/artec_eplus48u.c') diff --git a/backend/artec_eplus48u.c b/backend/artec_eplus48u.c index c26fbb0..bc3b2f8 100644 --- a/backend/artec_eplus48u.c +++ b/backend/artec_eplus48u.c @@ -67,7 +67,7 @@ Updates (C) 2001 by Henning Meier-Geinitz. whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ -#define BUILD 11 +#define BUILD 12 #include "../include/sane/config.h" @@ -3580,6 +3580,14 @@ load_calibration_data (Artec48U_Scanner * s) s->calibrated = SANE_FALSE; path[0] = 0; + + /* return SANE_STATUS_INVAL if HOME environment variable is not set */ + if (getenv ("HOME") == NULL) + { + XDBG ((1, "Environment variable HOME not set\n")); + return SANE_STATUS_INVAL; + } + if (strlen (getenv ("HOME")) < (PATH_MAX - 1)) strcat (path, getenv ("HOME")); else @@ -3690,6 +3698,14 @@ save_calibration_data (Artec48U_Scanner * s) mode_t mode = S_IRUSR | S_IWUSR; path[0] = 0; + + /* return SANE_STATUS_INVAL if HOME environment variable is not set */ + if (getenv ("HOME") == NULL) + { + XDBG ((1, "Environment variable HOME not set\n")); + return SANE_STATUS_INVAL; + } + if (strlen (getenv ("HOME")) < (PATH_MAX - 1)) strcat (path, getenv ("HOME")); else -- cgit v1.2.3