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
252aeb43
Commit
252aeb43
authored
May 15, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for GH-232
parent
24fe24b3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
tests/main.c
tests/main.c
+2
-0
tests/nghttp2_buf_test.c
tests/nghttp2_buf_test.c
+20
-0
tests/nghttp2_buf_test.h
tests/nghttp2_buf_test.h
+1
-0
No files found.
tests/main.c
View file @
252aeb43
...
...
@@ -340,6 +340,8 @@ int main(int argc _U_, char *argv[] _U_) {
!
CU_add_test
(
pSuite
,
"check_header_value"
,
test_nghttp2_check_header_value
)
||
!
CU_add_test
(
pSuite
,
"bufs_add"
,
test_nghttp2_bufs_add
)
||
!
CU_add_test
(
pSuite
,
"bufs_add_stack_buffer_overflow_bug"
,
test_nghttp2_bufs_add_stack_buffer_overflow_bug
)
||
!
CU_add_test
(
pSuite
,
"bufs_addb"
,
test_nghttp2_bufs_addb
)
||
!
CU_add_test
(
pSuite
,
"bufs_orb"
,
test_nghttp2_bufs_orb
)
||
!
CU_add_test
(
pSuite
,
"bufs_remove"
,
test_nghttp2_bufs_remove
)
||
...
...
tests/nghttp2_buf_test.c
View file @
252aeb43
...
...
@@ -63,6 +63,26 @@ void test_nghttp2_bufs_add(void) {
nghttp2_bufs_free
(
&
bufs
);
}
/* Test for GH-232, stack-buffer-overflow */
void
test_nghttp2_bufs_add_stack_buffer_overflow_bug
(
void
)
{
int
rv
;
nghttp2_bufs
bufs
;
uint8_t
data
[
1024
];
nghttp2_mem
*
mem
;
mem
=
nghttp2_mem_default
();
rv
=
nghttp2_bufs_init
(
&
bufs
,
100
,
200
,
mem
);
CU_ASSERT
(
0
==
rv
);
rv
=
nghttp2_bufs_add
(
&
bufs
,
data
,
sizeof
(
data
));
CU_ASSERT
(
0
==
rv
);
CU_ASSERT
(
sizeof
(
data
)
==
nghttp2_bufs_len
(
&
bufs
));
nghttp2_bufs_free
(
&
bufs
);
}
void
test_nghttp2_bufs_addb
(
void
)
{
int
rv
;
nghttp2_bufs
bufs
;
...
...
tests/nghttp2_buf_test.h
View file @
252aeb43
...
...
@@ -26,6 +26,7 @@
#define NGHTTP2_BUF_TEST_H
void
test_nghttp2_bufs_add
(
void
);
void
test_nghttp2_bufs_add_stack_buffer_overflow_bug
(
void
);
void
test_nghttp2_bufs_addb
(
void
);
void
test_nghttp2_bufs_orb
(
void
);
void
test_nghttp2_bufs_remove
(
void
);
...
...
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