diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-10-08 12:33:06 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-10-08 12:33:06 +0200 |
commit | 24feb9f37f302c006ba51502da817325200e74d0 (patch) | |
tree | d4451782449e5fcbae9cbe3778c51a8c6cb3c36d /backend/artec_eplus48u.c | |
parent | 76b69ebb381d40458339c9940135740797cbd2d4 (diff) | |
parent | cfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (diff) |
Merge tag 'upstream/1.0.25'
Upstream version 1.0.25
Diffstat (limited to 'backend/artec_eplus48u.c')
-rw-r--r-- | backend/artec_eplus48u.c | 18 |
1 files changed, 17 insertions, 1 deletions
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 |