From 5e295815bf78a14db5aa64b398a980b980061ea2 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Sat, 15 Feb 2025 22:42:46 -0500 Subject: [PATCH] module-rtp-sap: Add a couple of SDP parsing validations --- src/modules/module-rtp-sap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/module-rtp-sap.c b/src/modules/module-rtp-sap.c index fb37982b5..9eeb85024 100644 --- a/src/modules/module-rtp-sap.c +++ b/src/modules/module-rtp-sap.c @@ -1427,7 +1427,8 @@ static int parse_sdp_a_ssrc(struct impl *impl, char *c, struct sdp_info *info) return 0; c += strlen("a=ssrc:"); - spa_atou32(c, &info->ssrc, 10); + if (!spa_atou32(c, &info->ssrc, 10)) + return -EINVAL; return 0; } @@ -1437,7 +1438,8 @@ static int parse_sdp_a_ptime(struct impl *impl, char *c, struct sdp_info *info) return 0; c += strlen("a=ptime:"); - spa_atof(c, &info->ptime); + if (!spa_atof(c, &info->ptime)) + return -EINVAL; return 0; }