From 88df3af0bbd35ed31975ef6b66bf1daea64321a6 Mon Sep 17 00:00:00 2001 From: Peter Fales Date: Thu, 5 May 2005 03:52:03 +0000 Subject: [PATCH] When no port is specified in the gphoto2.conf config file, an attempt was being made to strdup() a bad pointer. --- ChangeLog | 4 ++++ backend/gphoto2.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6aacbd95b..a122db041 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-05-02 Peter Fales + * backend/gphoto2.c: Fix core dump when no port is specified in + the gphoto2 config file. (bug #301552) + 2005-04-29 Henning Meier-Geinitz * doc/descriptions/sp15c.desc: Added ScanPartner 600C (bug diff --git a/backend/gphoto2.c b/backend/gphoto2.c index 93c2bb310..5cba222bf 100644 --- a/backend/gphoto2.c +++ b/backend/gphoto2.c @@ -833,13 +833,13 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback UNUSEDARG authorize) fclose (fp); } - dev[0].name = strdup (Cam_data.port); - DBG (3, "sane_init: about to init_gphoto2\n"); if (init_gphoto2 () != SANE_STATUS_GOOD) return SANE_STATUS_INVAL; + dev[0].name = strdup (Cam_data.port); + DBG (3, "sane_init: about to get_info\n"); if (get_info () != SANE_STATUS_GOOD) {