summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2017-04-13 07:58:13 +0200
committerMarcus Meissner <marcus@jet.franken.de>2017-04-13 07:58:13 +0200
commit3165c248319dc9f4ab2d032e83dbd96355e4af1e (patch)
tree8174fd2d7b2ab3024fa394a0886511cfd1aef777
parent36e5b44ae84ff045ba77188b8e960e99fefaee8d (diff)
downloadlibgphoto2-3165c248319dc9f4ab2d032e83dbd96355e4af1e.tar.gz
stat the replacement DCIM directory to avoid bad data
-rw-r--r--libgphoto2_port/vusb/vcamera.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libgphoto2_port/vusb/vcamera.c b/libgphoto2_port/vusb/vcamera.c
index edff59329..4b3689e55 100644
--- a/libgphoto2_port/vusb/vcamera.c
+++ b/libgphoto2_port/vusb/vcamera.c
@@ -432,6 +432,7 @@ read_tree(char *path) {
first_dirent->fsname = strdup(path);
first_dirent->id = ptp_objectid++;
first_dirent->next = NULL;
+ stat(first_dirent->fsname, &first_dirent->stbuf); /* assuming it works */
root = first_dirent;
read_directories(path,first_dirent);
@@ -449,6 +450,7 @@ read_tree(char *path) {
dcim->id = ptp_objectid++;
dcim->next = first_dirent;
dcim->parent = root;
+ stat(dcim->fsname, &dcim->stbuf); /* assuming it works */
first_dirent = dcim;
}
}