Skip to content

Commit

Permalink
Add another test for bad index file.
Browse files Browse the repository at this point in the history
  • Loading branch information
weetmuts committed Jan 20, 2024
1 parent 33e6bd8 commit 6ec7131
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions autoconf/spec.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ CFLAGS:=@CFLAGS@
CXX:=@CXX@
CXXFLAGS_debug:=@CXXFLAGS_debug@
CXXFLAGS_release:=@CXXFLAGS_release@
CXXFLAGS_asan:=@CXXFLAGS_asan@
CXXFLAGS:=@CXXFLAGS@ $(FUSE_CFLAGS) $(LIBNOTIFY_CFLAGS) $(OPENSSL_CFLAGS) $(ZLIB_CFLAGS) $(LIBRSYNC_CFLAGS) $(MEDIA_CFLAGS) $(PLATFORM_CFLAGS)

LD:=@LD@
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,12 @@ CXXFLAGS="-DPLATFORM_${PLATFORM} ${CXXFLAGS_EXTRAS} -D${MNEMONIC} -Wall -Wno-err

CXXFLAGS_asan="-O0 -g ${ASAN_CFLAGS}"
CXXFLAGS_debug="-O0 -g"
CXXFLAGS_release="-Os"
CXXFLAGS_release="-O2"

LDFLAGS=""
LDFLAGS_asan="-g ${ASAN_LDFLAGS} ${MEDIA_LIBS}"
LDFLAGS_debug="-g ${MEDIA_LIBS}"
LDFLAGS_release="-Os"
LDFLAGS_release="-O2"
LDFLAGSEND_asan=""
LDFLAGSBEGIN_asan="${ASAN_LIBS} ${MEDIA_LIBS}"
LDFLAGSEND_debug=""
Expand Down
4 changes: 4 additions & 0 deletions src/index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ RC Index::loadIndex(vector<char> &v,
break;
}
// Remove the newline at the end.
if (tar_file.length() == 0) {
failure(INDEX, "File format error gz file. [%d]\n", __LINE__);
break;
}
tar_file.pop_back();
if (tar_file.length()==0) continue;
auto dots = tar_file.find(" ... ");
Expand Down

0 comments on commit 6ec7131

Please sign in to comment.