From 5fc5a9ef5fa4e443c4783095459f2ccf38381fe7 Mon Sep 17 00:00:00 2001 From: wxf Date: Fri, 18 Jun 2021 13:36:25 +0800 Subject: [PATCH] =?UTF-8?q?webrtc:=20=E4=BF=AE=E6=AD=A3=20sdp=20=E4=B8=AD?= =?UTF-8?q?=20candidate=20=E8=A7=A3=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 见 https://datatracker.ietf.org/doc/html/rfc5245#section-15.1 > foundation = 1*32ice-char --- webrtc/Sdp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index 369b3ca8..892a9afb 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -704,12 +704,13 @@ string SdpAttrSctpMap::toString() const { } void SdpAttrCandidate::parse(const string &str) { - char foundation_buf[32] = {0}; + char foundation_buf[40] = {0}; char transport_buf[16] = {0}; char address_buf[32] = {0}; char type_buf[16] = {0}; - if (7 != sscanf(str.data(), "%31[^ ] %" SCNu32 " %15[^ ] %" SCNu32 " %31[^ ] %" SCNu16 " typ %15[^ ]", + // https://datatracker.ietf.org/doc/html/rfc5245#section-15.1 + if (7 != sscanf(str.data(), "%32[^ ] %" SCNu32 " %15[^ ] %" SCNu32 " %31[^ ] %" SCNu16 " typ %15[^ ]", foundation_buf, &component, transport_buf, &priority, address_buf, &port, type_buf)) { SDP_THROW(); }