From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 49EFC40D78 for ; Mon, 7 Feb 2022 10:37:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1D2FC68B290; Mon, 7 Feb 2022 12:37:53 +0200 (EET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B762F68B269 for ; Mon, 7 Feb 2022 12:37:46 +0200 (EET) Received: by mail-pl1-f175.google.com with SMTP id k17so10834496plk.0 for ; Mon, 07 Feb 2022 02:37:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=XtWmvWoH6e5XY7/pGgnDiSmf4GSuiozZP9BqBldKyM8=; b=GptSmOk6XlPcbn6lBWNs1sT8PnET9VRoRA5TPDMdcb4X6t4/+FPXPknPm/j0gb5DLa VJBtxHBEzLCN0PJ6UjDBMiZ1/Kk2UGL8LjIiCheW9QXeAu0LeTmeBEPTWdBOthawcXy9 s9qkh3dWfzgom4VWBjXZUZoHdhDu6/FJkBPBjALHeL3ETKgjO5WNC+XC0UDAivbRBiuF y9uBVeEI4VpB9Odh7dIgwgHlsP4g5z/O60Z09n6Thlzgi6eIIlzjcci4ok3ry+Lnj8qw soqenqV2tHlicQySDsMYGMhhF3gzn3iNvm+nPjtmy8PbuYyYgZjfHoSWp1yYb0zD7oBW 900g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XtWmvWoH6e5XY7/pGgnDiSmf4GSuiozZP9BqBldKyM8=; b=qHUVVEmzcoFmaf0TIau/0lp0l4w76zo/bzrn60z4cAsxYJvtL3zIIleekrVFatuhUo x2/Dp9cGx2V30yT+HCuGDS11IYDYxQHokE+ADEcdYak6qt55ZawWXMbW4sNrFzq6e+Az gnRI7jkLC+yfX9UmtmPqo8WWkEPdHa0eT2CWpPrUqIoPKGyvwKtUq2S1qDUBOdivEax6 ww4aH24TMb4w+VIoPgXMOc8mq2MXrJhTL/EIDSEBXjWM3aHnrAs9Kqyu1Ehp+uTi6LDb pjFN9x5xaOW5RzRsWuQSHx1emnzt8LK1C6TEL9VhRu9uTYi7gLi2FcdjewJ+WJgtvIQp gL+Q== X-Gm-Message-State: AOAM531H5riCSRcSH1/v7VC/8uiAM86/naubmups+fUa5mt7SDGHk4la DvTlxqs5xWYjDRV7ipCpbkm8AXT+Phk= X-Google-Smtp-Source: ABdhPJzTeM2miYOXppShS5TsJMvTXgOeAw2R6jFGSF/wfR/+7yp5h0DxRogab5CAS60Zxx5bMHPLBw== X-Received: by 2002:a17:90a:c283:: with SMTP id f3mr14741866pjt.138.1644230264792; Mon, 07 Feb 2022 02:37:44 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id n3sm10794462pfu.84.2022.02.07.02.37.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Feb 2022 02:37:44 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 7 Feb 2022 18:37:40 +0800 Message-Id: <1644230260-31752-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH] avformat/udp: properly check for valid ttl in url X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Limin Wang MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Limin Wang Zhao Zhili added a ttl upper bound in commit 9daac85da8, but the check for ttl in url is missing still. Signed-off-by: Limin Wang --- libavformat/udp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/udp.c b/libavformat/udp.c index da56c8e..401d9b6 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -674,6 +674,11 @@ static int udp_open(URLContext *h, const char *uri, int flags) } if (av_find_info_tag(buf, sizeof(buf), "ttl", p)) { s->ttl = strtol(buf, NULL, 10); + if (s->ttl < 0 || s->ttl > 255) { + av_log(h, AV_LOG_ERROR, "ttl(%d) should be in range [0,255]\n", s->ttl); + ret = AVERROR(EINVAL); + goto fail; + } } if (av_find_info_tag(buf, sizeof(buf), "udplite_coverage", p)) { s->udplite_coverage = strtol(buf, NULL, 10); -- 1.8.3.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".