Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
5a725dab
Commit
5a725dab
authored
8 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Mark some torgzip lines as unreachable/untestable.
parent
358fc026
Branches
bug16937-02
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/common/torgzip.c
+9
-2
9 additions, 2 deletions
src/common/torgzip.c
with
9 additions
and
2 deletions
src/common/torgzip.c
+
9
−
2
View file @
5a725dab
...
...
@@ -158,9 +158,11 @@ tor_gzip_compress(char **out, size_t *out_len,
method_bits
(
method
,
HIGH_COMPRESSION
),
get_memlevel
(
HIGH_COMPRESSION
),
Z_DEFAULT_STRATEGY
)
!=
Z_OK
)
{
//LCOV_EXCL_START -- we can only provoke failure by giving junk arguments.
log_warn
(
LD_GENERAL
,
"Error from deflateInit2: %s"
,
stream
->
msg
?
stream
->
msg
:
"<no message>"
);
goto
err
;
//LCOV_EXCL_STOP
}
/* Guess 50% compression. */
...
...
@@ -214,8 +216,11 @@ tor_gzip_compress(char **out, size_t *out_len,
tor_assert
(
stream
->
total_out
>=
0
);
#endif
if
(
deflateEnd
(
stream
)
!=
Z_OK
)
{
// LCOV_EXCL_START -- unreachable if we handled the zlib structure right
tor_assert_nonfatal_unreached
();
log_warn
(
LD_BUG
,
"Error freeing gzip structures"
);
goto
err
;
// LCOV_EXCL_STOP
}
tor_free
(
stream
);
...
...
@@ -274,9 +279,11 @@ tor_gzip_uncompress(char **out, size_t *out_len,
if
(
inflateInit2
(
stream
,
method_bits
(
method
,
HIGH_COMPRESSION
))
!=
Z_OK
)
{
// LCOV_EXCL_START -- can only hit this if we give bad inputs.
log_warn
(
LD_GENERAL
,
"Error from inflateInit2: %s"
,
stream
->
msg
?
stream
->
msg
:
"<no message>"
);
goto
err
;
// LCOV_EXCL_STOP
}
out_size
=
in_len
*
2
;
/* guess 50% compression. */
...
...
@@ -434,10 +441,10 @@ tor_zlib_new(int compress, compress_method_t method,
if
(
deflateInit2
(
&
out
->
stream
,
Z_BEST_COMPRESSION
,
Z_DEFLATED
,
bits
,
memlevel
,
Z_DEFAULT_STRATEGY
)
!=
Z_OK
)
goto
err
;
goto
err
;
// LCOV_EXCL_LINE
}
else
{
if
(
inflateInit2
(
&
out
->
stream
,
bits
)
!=
Z_OK
)
goto
err
;
goto
err
;
// LCOV_EXCL_LINE
}
out
->
allocation
=
tor_zlib_state_size_precalc
(
!
compress
,
bits
,
memlevel
);
...
...
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