Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
deac9088
Commit
deac9088
authored
Jun 29, 2019
by
ineol
Committed by
Juliusz Chroboczek
Jul 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cases where the parser reads a byte too far
parent
d845d559
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
message.c
message.c
+9
-9
No files found.
message.c
View file @
deac9088
...
@@ -146,7 +146,7 @@ parse_update_subtlv(struct interface *ifp, int metric, int ae,
...
@@ -146,7 +146,7 @@ parse_update_subtlv(struct interface *ifp, int metric, int ae,
continue
;
continue
;
}
}
if
(
i
+
1
>
alen
)
if
(
i
+
2
>
alen
)
goto
fail
;
goto
fail
;
len
=
a
[
i
+
1
];
len
=
a
[
i
+
1
];
if
(
i
+
len
+
2
>
alen
)
if
(
i
+
len
+
2
>
alen
)
...
@@ -203,7 +203,7 @@ parse_hello_subtlv(const unsigned char *a, int alen,
...
@@ -203,7 +203,7 @@ parse_hello_subtlv(const unsigned char *a, int alen,
continue
;
continue
;
}
}
if
(
i
+
1
>
alen
)
{
if
(
i
+
2
>
alen
)
{
fprintf
(
stderr
,
"Received truncated sub-TLV on Hello.
\n
"
);
fprintf
(
stderr
,
"Received truncated sub-TLV on Hello.
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -257,7 +257,7 @@ parse_ihu_subtlv(const unsigned char *a, int alen,
...
@@ -257,7 +257,7 @@ parse_ihu_subtlv(const unsigned char *a, int alen,
continue
;
continue
;
}
}
if
(
i
+
1
>
alen
)
{
if
(
i
+
2
>
alen
)
{
fprintf
(
stderr
,
"Received truncated sub-TLV on IHU.
\n
"
);
fprintf
(
stderr
,
"Received truncated sub-TLV on IHU.
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -314,11 +314,11 @@ parse_request_subtlv(int ae, const unsigned char *a, int alen,
...
@@ -314,11 +314,11 @@ parse_request_subtlv(int ae, const unsigned char *a, int alen,
continue
;
continue
;
}
}
if
(
i
+
1
>
alen
)
if
(
i
+
2
>
alen
)
goto
fail
;
goto
fail
;
len
=
a
[
i
+
1
];
len
=
a
[
i
+
1
];
if
(
i
+
len
>
alen
)
if
(
i
+
2
+
len
>
alen
)
goto
fail
;
goto
fail
;
if
(
type
==
SUBTLV_PADN
)
{
if
(
type
==
SUBTLV_PADN
)
{
...
@@ -367,7 +367,7 @@ parse_seqno_request_subtlv(int ae, const unsigned char *a, int alen,
...
@@ -367,7 +367,7 @@ parse_seqno_request_subtlv(int ae, const unsigned char *a, int alen,
continue
;
continue
;
}
}
if
(
i
+
1
>
alen
)
if
(
i
+
2
>
alen
)
goto
fail
;
goto
fail
;
len
=
a
[
i
+
1
];
len
=
a
[
i
+
1
];
if
(
i
+
len
+
2
>
alen
)
if
(
i
+
len
+
2
>
alen
)
...
@@ -413,10 +413,10 @@ parse_other_subtlv(const unsigned char *a, int alen)
...
@@ -413,10 +413,10 @@ parse_other_subtlv(const unsigned char *a, int alen)
continue
;
continue
;
}
}
if
(
i
+
1
>
alen
)
if
(
i
+
2
>
alen
)
goto
fail
;
goto
fail
;
len
=
a
[
i
+
1
];
len
=
a
[
i
+
1
];
if
(
i
+
len
>
alen
)
if
(
i
+
2
+
len
>
alen
)
goto
fail
;
goto
fail
;
if
((
type
&
0x80
)
!=
0
)
{
if
((
type
&
0x80
)
!=
0
)
{
...
@@ -504,7 +504,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -504,7 +504,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
i
++
;
i
++
;
continue
;
continue
;
}
}
if
(
i
+
1
>
bodylen
)
{
if
(
i
+
2
>
bodylen
)
{
fprintf
(
stderr
,
"Received truncated message.
\n
"
);
fprintf
(
stderr
,
"Received truncated message.
\n
"
);
break
;
break
;
}
}
...
...
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