Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmp_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
5e6d3044
Commit
5e6d3044
authored
Apr 19, 2024
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
Detect error if cmp_par is NULL
parent
90487e27
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!32
Add fuzzing testing setup
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/common/cmp_error.c
+2
-0
2 additions, 0 deletions
lib/common/cmp_error.c
lib/common/cmp_error_list.h
+1
-0
1 addition, 0 deletions
lib/common/cmp_error_list.h
lib/icu_compress/cmp_icu.c
+1
-0
1 addition, 0 deletions
lib/icu_compress/cmp_icu.c
with
4 additions
and
0 deletions
lib/common/cmp_error.c
+
2
−
0
View file @
5e6d3044
...
...
@@ -88,6 +88,8 @@ const char* cmp_get_error_string(enum cmp_error code)
return
"Buffer related parameter is not valid"
;
case
CMP_ERROR_PAR_MAX_USED_BITS
:
return
"Maximum used bits parameters are not valid"
;
case
CMP_ERROR_PAR_NULL
:
return
"Pointer to the compression parameters structure is NULL."
;
case
CMP_ERROR_CHUNK_NULL
:
return
"Pointer to the chunk is NULL. No data, no compression"
;
...
...
This diff is collapsed.
Click to expand it.
lib/common/cmp_error_list.h
+
1
−
0
View file @
5e6d3044
...
...
@@ -35,6 +35,7 @@ enum cmp_error {
CMP_ERROR_PAR_SPECIFIC
=
21
,
CMP_ERROR_PAR_BUFFERS
=
22
,
CMP_ERROR_PAR_MAX_USED_BITS
=
23
,
CMP_ERROR_PAR_NULL
=
24
,
/* chunk errors */
CMP_ERROR_CHUNK_NULL
=
40
,
CMP_ERROR_CHUNK_TOO_LARGE
=
41
,
...
...
This diff is collapsed.
Click to expand it.
lib/icu_compress/cmp_icu.c
+
1
−
0
View file @
5e6d3044
...
...
@@ -2688,6 +2688,7 @@ uint32_t compress_chunk(void *chunk, uint32_t chunk_size,
size_t
read_bytes
;
RETURN_ERROR_IF
(
chunk
==
NULL
,
CHUNK_NULL
,
""
);
RETURN_ERROR_IF
(
cmp_par
==
NULL
,
PAR_NULL
,
""
);
RETURN_ERROR_IF
(
chunk_size
<
COLLECTION_HDR_SIZE
,
CHUNK_SIZE_INCONSISTENT
,
"chunk_size: %"
PRIu32
""
,
chunk_size
);
RETURN_ERROR_IF
(
chunk_size
>
CMP_ENTITY_MAX_ORIGINAL_SIZE
,
CHUNK_TOO_LARGE
,
...
...
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