Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tor
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
debian
tor
Commits
c8f94eed
Commit
c8f94eed
authored
14 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Oops; actually add the code to the last patch. :/
parent
971e83ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/or/routerparse.c
+17
-0
17 additions, 0 deletions
src/or/routerparse.c
with
17 additions
and
0 deletions
src/or/routerparse.c
+
17
−
0
View file @
c8f94eed
...
...
@@ -1583,6 +1583,10 @@ extrainfo_parse_entry_from_string(const char *s, const char *end,
authority_cert_t
*
authority_cert_parse_from_string
(
const
char
*
s
,
const
char
**
end_of_string
)
{
/** Reject any certificate at least this big; it is probably an overflow, an
* attack, a bug, or some other nonsense. */
#define MAX_CERT_SIZE (128*1024)
authority_cert_t
*
cert
=
NULL
,
*
old_cert
;
smartlist_t
*
tokens
=
NULL
;
char
digest
[
DIGEST_LEN
];
...
...
@@ -1609,6 +1613,12 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
++
eos
;
len
=
eos
-
s
;
if
(
len
>
MAX_CERT_SIZE
)
{
log_warn
(
LD_DIR
,
"Certificate is far too big (at %lu bytes long); "
"rejecting"
,
(
unsigned
long
)
len
);
return
NULL
;
}
tokens
=
smartlist_create
();
area
=
memarea_new
();
if
(
tokenize_string
(
area
,
s
,
eos
,
tokens
,
dir_key_certificate_table
,
0
)
<
0
)
{
...
...
@@ -3024,6 +3034,9 @@ get_next_token(memarea_t *area,
/** Reject any object at least this big; it is probably an overflow, an
* attack, a bug, or some other nonsense. */
#define MAX_UNPARSED_OBJECT_SIZE (128*1024)
/** Reject any line at least this big; it is probably an overflow, an
* attack, a bug, or some other nonsense. */
#define MAX_LINE_LENGTH (128*1024)
const
char
*
next
,
*
eol
,
*
obstart
;
size_t
obname_len
;
...
...
@@ -3043,6 +3056,10 @@ get_next_token(memarea_t *area,
eol
=
memchr
(
*
s
,
'\n'
,
eos
-*
s
);
if
(
!
eol
)
eol
=
eos
;
if
(
eol
-
*
s
>
MAX_LINE_LENGTH
)
{
RET_ERR
(
"Line far too long"
);
}
next
=
find_whitespace_eos
(
*
s
,
eol
);
if
(
!
strcmp_len
(
*
s
,
"opt"
,
next
-*
s
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment