已开启
质量加固 #853
wkljy创建于 7月28日
质量加固 #853
已开启
共 3 个文件变更+8-8
| @@ -21,12 +21,7 @@ ExtractResourceManager::ExtractResourceManager() | |||
| 21 | {} | 21 | {} |
| 22 | 22 | ||
| 23 | ExtractResourceManager::~ExtractResourceManager() | 23 | ExtractResourceManager::~ExtractResourceManager() |
| 24 | -{ | 24 | +{} |
| 25 | - std::lock_guard<std::mutex> lock(mutex_); | ||
| 26 | - if (!resourceManager_) { | ||
| 27 | - resourceManager_.reset(); | ||
| 28 | - } | ||
| 29 | -} | ||
| 30 | 25 | ||
| 31 | ExtractResourceManager& ExtractResourceManager::GetExtractResourceManager() | 26 | ExtractResourceManager& ExtractResourceManager::GetExtractResourceManager() |
| 32 | { | 27 | { |
| @@ -141,8 +141,8 @@ bool ZipFile::ParseEndDirectory() | |||
| 141 | size_t endFilePos = fileStartPos_ + fileLength_; | 141 | size_t endFilePos = fileStartPos_ + fileLength_; |
| 142 | 142 | ||
| 143 | if (fileLength_ <= endDirLen) { | 143 | if (fileLength_ <= endDirLen) { |
| 144 | - ABILITYBASE_LOGE("fileStartPos_:(%{public}llu) <= fileLength_:(%{public}llu)", | 144 | + ABILITYBASE_LOGE("fileLength_:(%{public}llu) <= endDirLen:(%{public}zu)", |
| 145 | - fileStartPos_, fileLength_); | 145 | + fileLength_, endDirLen); |
| 146 | return false; | 146 | return false; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| @@ -70,6 +70,11 @@ bool ZipFileReader::init() | |||
| 70 | if (filePath_.empty()) { | 70 | if (filePath_.empty()) { |
| 71 | return false; | 71 | return false; |
| 72 | } | 72 | } |
| 73 | + if (filePath_.length() > PATH_MAX) { | ||
| 74 | + ABILITYBASE_LOGE("failed:filePath_ length:%{public}u", | ||
| 75 | + static_cast<unsigned int>(filePath_.length())); | ||
| 76 | + return false; | ||
| 77 | + } | ||
| 73 | std::string resolvePath; | 78 | std::string resolvePath; |
| 74 | resolvePath.reserve(PATH_MAX); | 79 | resolvePath.reserve(PATH_MAX); |
| 75 | resolvePath.resize(PATH_MAX - 1); | 80 | resolvePath.resize(PATH_MAX - 1); |