Remove infinite loop if there's no dict in file
authorJonathan Dieter <jdieter@gmail.com>
Mon, 26 Mar 2018 09:30:07 +0000 (12:30 +0300)
committerJonathan Dieter <jdieter@gmail.com>
Mon, 26 Mar 2018 09:30:07 +0000 (12:30 +0300)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
src/lib/zck.c

index 63c713cd24b65ac7fe40a98d9be3f0cb33189a65..15232eae82fcf09fa6f555a2efcf2aef9f7caf09 100644 (file)
@@ -363,8 +363,10 @@ int zck_decompress_to_file(zckCtx *zck, int src_fd, int dst_fd) {
         size_t size = idx->length;
         char *cdata;
 
-        if(csize == 0)
+        if(csize == 0) {
+            idx = idx->next;
             continue;
+        }
 
         cdata = zmalloc(csize);
         if(cdata == NULL) {