]> git.seodisparate.com - SimpleArchiver/commitdiff
Fix error when checking with "-t"
authorStephen Seo <seo.disparate@gmail.com>
Thu, 18 Jul 2024 06:49:22 +0000 (15:49 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 18 Jul 2024 06:49:22 +0000 (15:49 +0900)
src/archiver.c

index e50cc829113da214d19ee15db04f7f160631b836..e098577037904bb3d4a3db77334f2e15b258d9ec 100644 (file)
@@ -736,7 +736,8 @@ int simple_archiver_parse_archive_info(FILE *in_f, int do_extract,
   int skip = 0;
   __attribute__((cleanup(simple_archiver_hash_map_free)))
   SDArchiverHashMap *hash_map = NULL;
-  if (state->parsed->working_files && state->parsed->working_files[0] != NULL) {
+  if (state && state->parsed->working_files &&
+      state->parsed->working_files[0] != NULL) {
     hash_map = simple_archiver_hash_map_init();
     for (char **iter = state->parsed->working_files; *iter != NULL; ++iter) {
       int len = strlen(*iter) + 1;