Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LSH
lsh
Commits
6e794712
Commit
6e794712
authored
Nov 20, 2001
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
(make_zlib_instance): Check return valus from
inflateInit and deflateInit. Rev: src/zlib.c:1.34
parent
475394e2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zlib.c
+16
-5
16 additions, 5 deletions
src/zlib.c
with
16 additions
and
5 deletions
src/zlib.c
+
16
−
5
View file @
6e794712
...
@@ -34,8 +34,6 @@
...
@@ -34,8 +34,6 @@
#if HAVE_ZLIB_H
#if HAVE_ZLIB_H
#include
<zlib.h>
#include
<zlib.h>
#else
#warning zlib.h not present
#endif
#endif
#include
<assert.h>
#include
<assert.h>
...
@@ -297,7 +295,8 @@ make_zlib_instance(struct compress_algorithm *c, int mode)
...
@@ -297,7 +295,8 @@ make_zlib_instance(struct compress_algorithm *c, int mode)
res
->
f
=
deflate
;
res
->
f
=
deflate
;
res
->
super
.
codec
=
do_zlib
;
res
->
super
.
codec
=
do_zlib
;
/* Maximum expansion is 0.1% + 12 bytes. We use 1% + 12, to be conservative.
/* Maximum expansion is 0.1% + 12 bytes. We use 1% + 12, to be
* conservative.
*
*
* FIXME: These figures are documented for the entire stream,
* FIXME: These figures are documented for the entire stream,
* does they really apply to all segments, separated by
* does they really apply to all segments, separated by
...
@@ -306,7 +305,13 @@ make_zlib_instance(struct compress_algorithm *c, int mode)
...
@@ -306,7 +305,13 @@ make_zlib_instance(struct compress_algorithm *c, int mode)
res
->
max
=
SSH_MAX_PACKET
+
SSH_MAX_PACKET
/
100
+
12
;
res
->
max
=
SSH_MAX_PACKET
+
SSH_MAX_PACKET
/
100
+
12
;
res
->
rate
=
RATE_UNIT
;
res
->
rate
=
RATE_UNIT
;
deflateInit
(
&
res
->
z
,
closure
->
level
);
if
(
deflateInit
(
&
res
->
z
,
closure
->
level
)
!=
Z_OK
)
{
werror
(
"deflateInit failed: %z
\n
"
,
res
->
z
.
msg
?
res
->
z
.
msg
:
"No error(?)"
);
KILL
(
res
);
return
NULL
;
}
break
;
break
;
case
COMPRESS_INFLATE
:
case
COMPRESS_INFLATE
:
...
@@ -319,7 +324,13 @@ make_zlib_instance(struct compress_algorithm *c, int mode)
...
@@ -319,7 +324,13 @@ make_zlib_instance(struct compress_algorithm *c, int mode)
res
->
max
=
SSH_MAX_PACKET
;
res
->
max
=
SSH_MAX_PACKET
;
res
->
rate
=
2
*
RATE_UNIT
;
res
->
rate
=
2
*
RATE_UNIT
;
inflateInit
(
&
res
->
z
);
if
(
inflateInit
(
&
res
->
z
)
!=
Z_OK
)
{
werror
(
"inflateInit failed: %z
\n
"
,
res
->
z
.
msg
?
res
->
z
.
msg
:
"No error(?)"
);
KILL
(
res
);
return
NULL
;
}
break
;
break
;
}
}
return
&
res
->
super
;
return
&
res
->
super
;
...
...
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