Browse Source

unpack.h: fix compiler warnings, improve error handling

Thomas Waldmann 3 years ago
parent
commit
a7d4dd2ba6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/borg/cache_sync/unpack.h

+ 5 - 0
src/borg/cache_sync/unpack.h

@@ -388,6 +388,11 @@ static inline int unpack_callback_raw(unpack_user* u, const char* b, const char*
             u->expect = expect_map_item_end;
         }
         break;
+    default:
+        if(u->inside_chunks) {
+            SET_LAST_ERROR("Unexpected raw in chunks structure");
+            return -1;
+        }
     }
     return 0;
 }