Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
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
pistache
Commits
b0aba763
Commit
b0aba763
authored
Aug 22, 2015
by
Mathieu STEFANI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed unitialized data in the parser
parent
29c0f686
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
src/http.cc
src/http.cc
+11
-1
src/http.h
src/http.h
+2
-0
No files found.
src/http.cc
View file @
b0aba763
...
...
@@ -24,6 +24,12 @@ static constexpr char CRLF[] = {CR, LF};
namespace
Private
{
Parser
::
Buffer
::
Buffer
()
:
len
(
0
)
{
memset
(
data
,
sizeof
data
,
0
);
}
bool
Parser
::
Cursor
::
advance
(
size_t
count
)
{
...
...
@@ -114,11 +120,15 @@ namespace Private {
else
if
(
tryMatch
(
"DELETE"
))
{
request
->
method
=
Method
::
Delete
;
}
else
{
raise
(
"Lol wat"
);
}
auto
n
=
cursor
.
next
();
if
(
n
==
Cursor
::
Eof
)
return
State
::
Again
;
else
if
(
n
!=
' '
)
raise
(
"Malformed HTTP Request"
);
if
(
!
cursor
.
advance
(
2
))
return
State
::
Again
;
size_t
start
=
cursor
;
...
...
src/http.h
View file @
b0aba763
...
...
@@ -131,6 +131,8 @@ namespace Private {
struct
Parser
{
struct
Buffer
{
Buffer
();
char
data
[
Const
::
MaxBuffer
];
size_t
len
;
};
...
...
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