Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
591f73e0
Commit
591f73e0
authored
Aug 21, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return error if nghttp2_gzip_inflate is invoked after Z_STREAM_END
parent
4d51def6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
lib/nghttp2_gzip.c
lib/nghttp2_gzip.c
+6
-1
lib/nghttp2_gzip.h
lib/nghttp2_gzip.h
+1
-0
No files found.
lib/nghttp2_gzip.c
View file @
591f73e0
...
@@ -33,6 +33,7 @@ int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr)
...
@@ -33,6 +33,7 @@ int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr)
if
(
*
inflater_ptr
==
NULL
)
{
if
(
*
inflater_ptr
==
NULL
)
{
return
NGHTTP2_ERR_NOMEM
;
return
NGHTTP2_ERR_NOMEM
;
}
}
(
*
inflater_ptr
)
->
finished
=
0
;
(
*
inflater_ptr
)
->
zst
.
next_in
=
Z_NULL
;
(
*
inflater_ptr
)
->
zst
.
next_in
=
Z_NULL
;
(
*
inflater_ptr
)
->
zst
.
avail_in
=
0
;
(
*
inflater_ptr
)
->
zst
.
avail_in
=
0
;
(
*
inflater_ptr
)
->
zst
.
zalloc
=
Z_NULL
;
(
*
inflater_ptr
)
->
zst
.
zalloc
=
Z_NULL
;
...
@@ -59,6 +60,9 @@ int nghttp2_gzip_inflate(nghttp2_gzip *inflater,
...
@@ -59,6 +60,9 @@ int nghttp2_gzip_inflate(nghttp2_gzip *inflater,
const
uint8_t
*
in
,
size_t
*
inlen_ptr
)
const
uint8_t
*
in
,
size_t
*
inlen_ptr
)
{
{
int
rv
;
int
rv
;
if
(
inflater
->
finished
)
{
return
NGHTTP2_ERR_GZIP
;
}
inflater
->
zst
.
avail_in
=
*
inlen_ptr
;
inflater
->
zst
.
avail_in
=
*
inlen_ptr
;
inflater
->
zst
.
next_in
=
(
unsigned
char
*
)
in
;
inflater
->
zst
.
next_in
=
(
unsigned
char
*
)
in
;
inflater
->
zst
.
avail_out
=
*
outlen_ptr
;
inflater
->
zst
.
avail_out
=
*
outlen_ptr
;
...
@@ -69,8 +73,9 @@ int nghttp2_gzip_inflate(nghttp2_gzip *inflater,
...
@@ -69,8 +73,9 @@ int nghttp2_gzip_inflate(nghttp2_gzip *inflater,
*
inlen_ptr
-=
inflater
->
zst
.
avail_in
;
*
inlen_ptr
-=
inflater
->
zst
.
avail_in
;
*
outlen_ptr
-=
inflater
->
zst
.
avail_out
;
*
outlen_ptr
-=
inflater
->
zst
.
avail_out
;
switch
(
rv
)
{
switch
(
rv
)
{
case
Z_OK
:
case
Z_STREAM_END
:
case
Z_STREAM_END
:
inflater
->
finished
=
1
;
case
Z_OK
:
case
Z_BUF_ERROR
:
case
Z_BUF_ERROR
:
return
0
;
return
0
;
case
Z_DATA_ERROR
:
case
Z_DATA_ERROR
:
...
...
lib/nghttp2_gzip.h
View file @
591f73e0
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
struct
nghttp2_gzip
{
struct
nghttp2_gzip
{
z_stream
zst
;
z_stream
zst
;
int8_t
finished
;
};
};
#endif
/* NGHTTP2_GZIP_H */
#endif
/* NGHTTP2_GZIP_H */
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