Projects
Eulaceura:Factory
libtar
_service:obs_scm:openEuler-CVE-2021-33643-CVE-2...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:openEuler-CVE-2021-33643-CVE-2021-33644.patch of Package libtar
From 6bacfdcb84a4b80c7c026e926b7e1f84d6eed26d Mon Sep 17 00:00:00 2001 From: shixuantong <1726671442@qq.com> Date: Wed, 6 Apr 2022 17:40:57 +0800 Subject: [PATCH] Ensure that sz is greater than 0. --- lib/block.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/block.c b/lib/block.c index 092bc28..80b41ac 100644 --- a/lib/block.c +++ b/lib/block.c @@ -118,6 +118,11 @@ th_read(TAR *t) if (TH_ISLONGLINK(t)) { sz = th_get_size(t); + if ((int)sz <= 0) + { + errno = EINVAL; + return -1; + } blocks = (sz / T_BLOCKSIZE) + (sz % T_BLOCKSIZE ? 1 : 0); if (blocks > ((size_t)-1 / T_BLOCKSIZE)) { @@ -168,6 +173,11 @@ th_read(TAR *t) if (TH_ISLONGNAME(t)) { sz = th_get_size(t); + if ((int)sz <= 0) + { + errno = EINVAL; + return -1; + } blocks = (sz / T_BLOCKSIZE) + (sz % T_BLOCKSIZE ? 1 : 0); if (blocks > ((size_t)-1 / T_BLOCKSIZE)) { -- 1.8.3.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2