Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
mongoose
Commits
77e44c7c
Commit
77e44c7c
authored
7 years ago
by
Deomid Ryabkov
Committed by
Cesanta Bot
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Harden MQTT variable length parsing
PUBLISHED_FROM=e16ee57bc30277e5b5684e53da78e69baaf9f779
parent
abf89d32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
mongoose.c
mongoose.c
+3
-2
No files found.
mongoose.c
View file @
77e44c7c
...
...
@@ -9943,11 +9943,12 @@ MG_INTERNAL int parse_mqtt(struct mbuf *io, struct mg_mqtt_message *mm) {
lc
=
*
((
const
unsigned
char
*
)
p
++
);
len
+=
(
lc
&
0x7f
)
<<
7
*
len_len
;
len_len
++
;
if
(
!
(
lc
&
0x80
)
||
(
len_len
>
sizeof
(
len
)))
break
;
if
(
!
(
lc
&
0x80
))
break
;
if
(
len_len
>
4
)
return
-
2
;
}
end
=
p
+
len
;
if
(
lc
&
0x80
||
end
>
io
->
buf
+
io
->
len
)
{
if
(
lc
&
0x80
||
len
>
(
io
->
len
-
(
p
-
io
->
buf
))
)
{
return
-
1
;
}
...
...
This diff is collapsed.
Click to expand it.
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