Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
apk-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sertonix
apk-tools
Commits
c7c8ab7c
Commit
c7c8ab7c
authored
5 years ago
by
Reid Rankin
Committed by
Timo Teräs
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
don't use hardcoded checksum buffer sizes
parent
aa882df5
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/apk_blob.h
+6
-3
6 additions, 3 deletions
src/apk_blob.h
src/manifest.c
+2
-2
2 additions, 2 deletions
src/manifest.c
with
8 additions
and
5 deletions
src/apk_blob.h
+
6
−
3
View file @
c7c8ab7c
...
...
@@ -36,12 +36,15 @@ extern apk_blob_t apk_null_blob;
#define APK_CHECKSUM_MD5 16
#define APK_CHECKSUM_SHA1 20
#define APK_CHECKSUM_DEFAULT APK_CHECKSUM_SHA1
#define APK_CHECKSUM_MAX APK_CHECKSUM_SHA1
#define APK_BLOB_CHECKSUM_BUF 34
/* Enough space for a hexdump of the longest checksum possible plus
* a two-character type prefix */
#define APK_BLOB_CHECKSUM_BUF (2 + (2 * APK_CHECKSUM_MAX))
/* Internal co
i
ntainer for
MD5 or SHA1
*/
/* Internal container for
checksums
*/
struct
apk_checksum
{
unsigned
char
data
[
20
];
unsigned
char
data
[
APK_CHECKSUM_MAX
];
unsigned
char
type
;
};
...
...
This diff is collapsed.
Click to expand it.
src/manifest.c
+
2
−
2
View file @
c7c8ab7c
...
...
@@ -36,7 +36,7 @@ static void process_package(struct apk_database *db, struct apk_package *pkg)
struct
apk_db_dir_instance
*
diri
;
struct
apk_db_file
*
file
;
struct
hlist_node
*
dc
,
*
dn
,
*
fc
,
*
fn
;
char
csum_buf
[
(
APK_CHECKSUM_
SHA1
*
2
)
+
1
];
char
csum_buf
[
APK_
BLOB_
CHECKSUM_
BUF
];
if
(
ipkg
==
NULL
)
return
;
...
...
@@ -62,7 +62,7 @@ static int read_file_entry(void *ctx, const struct apk_file_info *ae,
struct
apk_istream
*
is
)
{
struct
manifest_file_ctx
*
mctx
=
ctx
;
char
csum_buf
[
(
APK_CHECKSUM_
SHA1
*
2
)
+
1
];
char
csum_buf
[
APK_
BLOB_
CHECKSUM_
BUF
];
apk_blob_t
csum_blob
=
APK_BLOB_BUF
(
csum_buf
);
int
r
;
...
...
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