Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
binwalk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
binwalk
Commits
8f06d72b
Commit
8f06d72b
authored
Nov 18, 2013
by
heffnercj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed null pointer dereference in tinfl.c
parent
252d9c9c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
tinfl.c
src/C/miniz/tinfl.c
+11
-2
No files found.
src/C/miniz/tinfl.c
View file @
8f06d72b
...
...
@@ -457,6 +457,9 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex
}
}
#endif
/* CJH: Check for NULL pointers */
if
(
!
pOut_buf_cur
||
!
pSrc
)
goto
common_exit
;
do
{
pOut_buf_cur
[
0
]
=
pSrc
[
0
];
...
...
@@ -630,7 +633,7 @@ int inflate_raw_file(char *in_file, char *out_file)
{
decompressed_data
=
(
char
*
)
tinfl_decompress_mem_to_heap
(
compressed_data
,
in_size
,
&
out_size
,
0
);
if
(
decompressed_data
)
if
(
decompressed_data
&&
out_size
>
0
)
{
fwrite
(
decompressed_data
,
1
,
out_size
,
fp_out
);
free
(
decompressed_data
);
...
...
@@ -681,7 +684,13 @@ int inflate_raw_file(char *in_file, char *out_file)
#ifdef MAIN
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
!=
3
)
{
fprintf
(
stderr
,
"Usage: %s <input file> <output file>
\n
"
,
argv
[
0
]);
return
EXIT_FAILURE
;
}
printf
(
"Inflated to %d bytes.
\n
"
,
inflate_raw_file
(
argv
[
1
],
argv
[
2
]));
return
0
;
return
EXIT_SUCCESS
;
}
#endif
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