From b219ac3f2eabdef00579dc5b00210372cd0fda14 Mon Sep 17 00:00:00 2001 From: hunili Date: Sun, 18 Aug 2024 16:17:51 +0800 Subject: [PATCH] Modify untar logic issue: https://gitee.com/openharmony/filemanagement_app_file_service/issues/IAKRVA Signed-off-by: hunili --- frameworks/native/backup_ext/src/untar_file.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frameworks/native/backup_ext/src/untar_file.cpp b/frameworks/native/backup_ext/src/untar_file.cpp index 05931009e..d04e7ebe6 100644 --- a/frameworks/native/backup_ext/src/untar_file.cpp +++ b/frameworks/native/backup_ext/src/untar_file.cpp @@ -130,7 +130,7 @@ std::tuple UntarFile::UnPacket( fclose(tarFilePtr_); tarFilePtr_ = nullptr; - return {ret, fileInfos, errInfos}; + return {0, fileInfos, errInfos}; } std::tuple UntarFile::IncrementalUnPacket( @@ -151,7 +151,7 @@ std::tuple UntarFile::IncrementalUnPacket( fclose(tarFilePtr_); tarFilePtr_ = nullptr; - return {ret, fileInfos, errFileInfos}; + return {0, fileInfos, errFileInfos}; } off_t UntarFile::HandleTarBuffer(const string &buff, const string &name, FileStatInfo &info) @@ -225,8 +225,8 @@ bool UntarFile::CheckIfTarBlockValid(char *buff, size_t buffLen, TarHeader *head if (tailRead == BLOCK_SIZE && IsEmptyBlock(tailBuff)) { HILOGE("Parsing tar file completed, tailBuff is empty."); ret = 0; + return false; } - return false; } // check header if (!IsValidTarBlock(*header)) { @@ -284,9 +284,9 @@ int UntarFile::DealIncreParseTarFileResult(const std::tuple