From 4a6a23f63e16dfd291ab8d43a6e5d0d6d49fef5d Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 11 Apr 2014 20:00:57 +0000 Subject: [PATCH] From: "Daniel P. Berrange" The _get_path method in the directory driver does not check the return value of _get_mountpoint causing it to use potentially uninitialized data. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14894 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/directory/directory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/camlibs/directory/directory.c b/camlibs/directory/directory.c index bb96a5951..549468d0a 100644 --- a/camlibs/directory/directory.c +++ b/camlibs/directory/directory.c @@ -227,6 +227,8 @@ _get_path (GPPort *port, const char *folder, const char *file, char *path, unsig char *xpath; ret = _get_mountpoint (port, &xpath); + if (ret < GP_OK) + return ret; snprintf (path, size, "%s/%s/%s", xpath, folder, file); } else { /* old style access */