Skip to content

Commit 7b0f560

Browse files
authored
Merge pull request #19308 from FRRouting/mergify/bp/stable/10.4/pr-19303
zebra: Fix buffer overflows found by fuzzing. (backport #19303)
2 parents 096fe49 + ac97700 commit 7b0f560

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

zebra/zapi_msg.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,6 +3012,11 @@ static void zread_srv6_manager_get_locator_chunk(struct zserv *client,
30123012

30133013
/* Get data. */
30143014
STREAM_GETW(s, len);
3015+
if (len > SRV6_LOCNAME_SIZE) {
3016+
zlog_warn("%s: SRv6 locator name length %u exceeds maximum %d", __func__, len,
3017+
SRV6_LOCNAME_SIZE);
3018+
goto stream_failure;
3019+
}
30153020
STREAM_GET(locator_name, s, len);
30163021

30173022
/* call hook to get a chunk using wrapper */
@@ -3032,6 +3037,11 @@ static void zread_srv6_manager_release_locator_chunk(struct zserv *client,
30323037

30333038
/* Get data. */
30343039
STREAM_GETW(s, len);
3040+
if (len > SRV6_LOCNAME_SIZE) {
3041+
zlog_warn("%s: SRv6 locator name length %u exceeds maximum %d", __func__, len,
3042+
SRV6_LOCNAME_SIZE);
3043+
goto stream_failure;
3044+
}
30353045
STREAM_GET(locator_name, s, len);
30363046

30373047
/* call hook to release a chunk using wrapper */

0 commit comments

Comments
 (0)