Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
apk-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adélie Linux
apk-tools
Commits
e48f441e
Commit
e48f441e
authored
8 years ago
by
Timo Teräs
Browse files
Options
Downloads
Patches
Plain Diff
tar: return correct error for short read of tar archive
(cherry picked from commit
ca368916
)
parent
483f64ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/archive.c
+8
-3
8 additions, 3 deletions
src/archive.c
with
8 additions
and
3 deletions
src/archive.c
+
8
−
3
View file @
e48f441e
...
...
@@ -105,12 +105,17 @@ static ssize_t tar_entry_read(void *stream, void *ptr, size_t size)
if
(
size
>
teis
->
bytes_left
)
size
=
teis
->
bytes_left
;
if
(
size
==
0
)
return
0
;
if
(
size
==
0
)
return
0
;
r
=
teis
->
tar_is
->
read
(
teis
->
tar_is
,
ptr
,
size
);
if
(
r
<
0
)
if
(
r
<=
0
)
{
/* If inner stream returned zero (end-of-stream), we
* are getting short read, because tar header indicated
* more was to be expected. */
if
(
r
==
0
)
return
-
ECONNABORTED
;
return
r
;
}
teis
->
bytes_left
-=
r
;
if
(
teis
->
csum
==
NULL
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment