File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -908,7 +908,7 @@ static int packfile_unpack_compressed(
908908
909909 do {
910910 size_t bytes = buffer_len - total ;
911- unsigned int window_len ;
911+ unsigned int window_len , consumed ;
912912 unsigned char * in ;
913913
914914 if ((in = pack_window_open (p , mwindow , * position , & window_len )) == NULL ) {
@@ -924,10 +924,15 @@ static int packfile_unpack_compressed(
924924
925925 git_mwindow_close (mwindow );
926926
927- if (!bytes )
928- break ;
927+ consumed = window_len - (unsigned int )zstream .in_len ;
928+
929+ if (!bytes && !consumed ) {
930+ git_error_set (GIT_ERROR_ZLIB , "error inflating zlib stream" );
931+ error = -1 ;
932+ goto out ;
933+ }
929934
930- * position += window_len - zstream . in_len ;
935+ * position += consumed ;
931936 total += bytes ;
932937 } while (!git_zstream_eos (& zstream ));
933938
You can’t perform that action at this time.
0 commit comments