Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
b1c5732f
Commit
b1c5732f
authored
May 23, 2016
by
Mark Haines
Browse files
Fix bug in bounds check when parsing
parent
182f33f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/message.cpp
View file @
b1c5732f
...
...
@@ -133,7 +133,7 @@ static std::uint8_t const * decode(
std
::
uint8_t
const
*
len_start
=
pos
;
pos
=
varint_skip
(
pos
,
end
);
std
::
size_t
len
=
varint_decode
<
std
::
size_t
>
(
len_start
,
pos
);
if
(
len
+
pos
>
end
)
return
end
;
if
(
len
>
std
::
size_t
(
end
-
pos
)
)
return
end
;
value
=
pos
;
value_length
=
len
;
pos
+=
len
;
...
...
@@ -154,7 +154,7 @@ static std::uint8_t const * skip_unknown(
std
::
uint8_t
const
*
len_start
=
pos
;
pos
=
varint_skip
(
pos
,
end
);
std
::
size_t
len
=
varint_decode
<
std
::
size_t
>
(
len_start
,
pos
);
if
(
len
+
pos
>
end
)
return
end
;
if
(
len
>
std
::
size_t
(
end
-
pos
)
)
return
end
;
pos
+=
len
;
}
else
{
return
end
;
...
...
Richard van der Hoff
@richardv
mentioned in commit
2f8d7ba8
·
Apr 17, 2019
mentioned in commit
2f8d7ba8
mentioned in commit 2f8d7ba80e12d9ac9f7dc527b3d31f4dcc0526f0
Toggle commit list
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