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
cf094bd5
Commit
cf094bd5
authored
Jun 05, 2020
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ubsan applying zero offset to null pointer occurred in unit test
parent
78a56cf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
lib/nghttp2_frame.c
lib/nghttp2_frame.c
+19
-3
lib/nghttp2_session.c
lib/nghttp2_session.c
+11
-1
No files found.
lib/nghttp2_frame.c
View file @
cf094bd5
...
...
@@ -899,9 +899,25 @@ nghttp2_settings_entry *nghttp2_frame_iv_copy(const nghttp2_settings_entry *iv,
}
int
nghttp2_nv_equal
(
const
nghttp2_nv
*
a
,
const
nghttp2_nv
*
b
)
{
return
a
->
namelen
==
b
->
namelen
&&
a
->
valuelen
==
b
->
valuelen
&&
memcmp
(
a
->
name
,
b
->
name
,
a
->
namelen
)
==
0
&&
memcmp
(
a
->
value
,
b
->
value
,
a
->
valuelen
)
==
0
;
if
(
a
->
namelen
!=
b
->
namelen
||
a
->
valuelen
!=
b
->
valuelen
)
{
return
0
;
}
if
(
a
->
name
==
NULL
||
b
->
name
==
NULL
)
{
assert
(
a
->
namelen
==
0
);
assert
(
b
->
namelen
==
0
);
}
else
if
(
memcmp
(
a
->
name
,
b
->
name
,
a
->
namelen
)
!=
0
)
{
return
0
;
}
if
(
a
->
value
==
NULL
||
b
->
value
==
NULL
)
{
assert
(
a
->
valuelen
==
0
);
assert
(
b
->
valuelen
==
0
);
}
else
if
(
memcmp
(
a
->
value
,
b
->
value
,
a
->
valuelen
)
!=
0
)
{
return
0
;
}
return
1
;
}
void
nghttp2_nv_array_del
(
nghttp2_nv
*
nva
,
nghttp2_mem
*
mem
)
{
...
...
lib/nghttp2_session.c
View file @
cf094bd5
...
...
@@ -5353,9 +5353,11 @@ static ssize_t inbound_frame_effective_readlen(nghttp2_inbound_frame *iframe,
return
(
ssize_t
)(
readlen
);
}
static
const
uint8_t
sin
[]
=
{
0
};
ssize_t
nghttp2_session_mem_recv
(
nghttp2_session
*
session
,
const
uint8_t
*
in
,
size_t
inlen
)
{
const
uint8_t
*
first
=
in
,
*
last
=
in
+
inlen
;
const
uint8_t
*
first
,
*
last
;
nghttp2_inbound_frame
*
iframe
=
&
session
->
iframe
;
size_t
readlen
;
ssize_t
padlen
;
...
...
@@ -5366,6 +5368,14 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in,
size_t
pri_fieldlen
;
nghttp2_mem
*
mem
;
if
(
in
==
NULL
)
{
assert
(
inlen
==
0
);
in
=
sin
;
}
first
=
in
;
last
=
in
+
inlen
;
DEBUGF
(
"recv: connection recv_window_size=%d, local_window=%d
\n
"
,
session
->
recv_window_size
,
session
->
local_window_size
);
...
...
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