diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2017-04-13 07:58:13 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2017-04-13 07:58:13 +0200 |
commit | 3165c248319dc9f4ab2d032e83dbd96355e4af1e (patch) | |
tree | 8174fd2d7b2ab3024fa394a0886511cfd1aef777 | |
parent | 36e5b44ae84ff045ba77188b8e960e99fefaee8d (diff) | |
download | libgphoto2-3165c248319dc9f4ab2d032e83dbd96355e4af1e.tar.gz |
stat the replacement DCIM directory to avoid bad data
-rw-r--r-- | libgphoto2_port/vusb/vcamera.c | 2 |
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; } } |