Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
apk-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
60
Issues
60
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
apk-tools
Commits
5496560a
Commit
5496560a
authored
Oct 07, 2014
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db: fix crash if unable to download cache item
fixes
#3371
parent
1bbca163
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/database.c
src/database.c
+3
-2
No files found.
src/database.c
View file @
5496560a
...
...
@@ -638,7 +638,8 @@ int apk_cache_download(struct apk_database *db, struct apk_repository *repo,
bs
=
apk_bstream_from_url
(
url
);
bs
=
apk_bstream_tee
(
bs
,
db
->
cache_fd
,
tmpcacheitem
,
cb
,
cb_ctx
);
is
=
apk_bstream_gunzip_mpart
(
bs
,
apk_sign_ctx_mpart_cb
,
&
sctx
);
r
=
apk_tar_parse
(
is
,
apk_sign_ctx_verify_tar
,
&
sctx
,
FALSE
,
&
db
->
id_cache
);
if
(
is
)
r
=
apk_tar_parse
(
is
,
apk_sign_ctx_verify_tar
,
&
sctx
,
FALSE
,
&
db
->
id_cache
);
else
r
=
-
errno
;
apk_sign_ctx_free
(
&
sctx
);
}
else
{
is
=
apk_istream_from_url
(
url
);
...
...
@@ -650,7 +651,7 @@ int apk_cache_download(struct apk_database *db, struct apk_repository *repo,
r
=
-
errno
;
}
}
is
->
close
(
is
);
i
f
(
is
)
i
s
->
close
(
is
);
if
(
r
<
0
)
{
unlinkat
(
db
->
cache_fd
,
tmpcacheitem
,
0
);
return
r
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment