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
Nick Mathewson
Tor
Commits
0878bb96
Commit
0878bb96
authored
Oct 25, 2018
by
Nick Mathewson
👉
Browse files
Fix two other cases of (buf + N > end) pattern
Related to fix for 28202.
parent
368413a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/or/routerparse.c
View file @
0878bb96
...
...
@@ -5299,13 +5299,13 @@ find_start_of_next_microdesc(const char *s, const char *eos)
return
NULL
;
#define CHECK_LENGTH() STMT_BEGIN \
if (
s+32 > eos)
\
if (
eos - s < 32)
\
return NULL; \
STMT_END
#define NEXT_LINE() STMT_BEGIN \
s = memchr(s, '\n', eos-s); \
if (!s ||
s+1 >= eos)
\
if (!s ||
eos - s <= 1)
\
return NULL; \
s++; \
STMT_END
...
...
@@ -5329,7 +5329,7 @@ find_start_of_next_microdesc(const char *s, const char *eos)
/* Okay, now we're pointed at the first line of the microdescriptor which is
not an annotation or onion-key. The next line that _is_ an annotation or
onion-key is the start of the next microdescriptor. */
while
(
s
+
32
<
eos
)
{
while
(
eos
-
s
>
32
)
{
if
(
*
s
==
'@'
||
!
strcmpstart
(
s
,
"onion-key"
))
return
s
;
NEXT_LINE
();
...
...
@@ -6359,4 +6359,3 @@ routerparse_free_all(void)
{
dump_desc_fifo_cleanup
();
}
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