WebKit Bugzilla
Attachment 346609 Details for
Bug 188337
: [libwebrtc] SafeSetError() in peerconnection.cc contains use-after-move of webrtc::RTCError variable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v1
bug-188337-20180805212107.patch (text/plain), 3.58 KB, created by
David Kilzer (:ddkilzer)
on 2018-08-05 19:21:07 PDT
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2018-08-05 19:21:07 PDT
Size:
3.58 KB
patch
obsolete
>Subversion Revision: 234580 >diff --git a/Source/ThirdParty/libwebrtc/ChangeLog b/Source/ThirdParty/libwebrtc/ChangeLog >index b9b03bb4772c5c7ed7235fd498e5ba2897e9a040..0326a968ec6479e936d2e48ec01687cec6c7131b 100644 >--- a/Source/ThirdParty/libwebrtc/ChangeLog >+++ b/Source/ThirdParty/libwebrtc/ChangeLog >@@ -1,3 +1,19 @@ >+2018-08-05 David Kilzer <ddkilzer@apple.com> >+ >+ [libwebrtc] SafeSetError() in peerconnection.cc contains use-after-move of webrtc::RTCError variable >+ <https://webkit.org/b/188337> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Source/webrtc/pc/peerconnection.cc: >+ (webrtc::SafeSetError): Make static since it's not used outside >+ this translation unit. >+ (webrtc::SafeSetError): Ditto. Change first argument to >+ webrtc::RTCError&& to prevent unnecessary copying of std::move() >+ argument. Fix bug by saving value of `error.ok()` before moving >+ to `*error_out`. >+ * WebKit/0013-Fix-SafeSetError-use-after-move.patch: Add patch. >+ > 2018-08-03 Alex Christensen <achristensen@webkit.org> > > Fix spelling of "overridden" >diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.cc >index 6281d57e3db7dc5716100d237dee617fc76b9026..1bebb0509a1006039cfbedca2e98440dfee21884 100644 >--- a/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.cc >+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.cc >@@ -226,18 +226,19 @@ uint32_t ConvertIceTransportTypeToCandidateFilter( > } > > // Helper to set an error and return from a method. >-bool SafeSetError(webrtc::RTCErrorType type, webrtc::RTCError* error) { >+static bool SafeSetError(webrtc::RTCErrorType type, webrtc::RTCError* error) { > if (error) { > error->set_type(type); > } > return type == webrtc::RTCErrorType::NONE; > } > >-bool SafeSetError(webrtc::RTCError error, webrtc::RTCError* error_out) { >+static bool SafeSetError(webrtc::RTCError&& error, webrtc::RTCError* error_out) { >+ bool result = error.ok(); > if (error_out) { > *error_out = std::move(error); > } >- return error.ok(); >+ return result; > } > > std::string GetSignalingStateString( >diff --git a/Source/ThirdParty/libwebrtc/WebKit/0013-Fix-SafeSetError-use-after-move.patch b/Source/ThirdParty/libwebrtc/WebKit/0013-Fix-SafeSetError-use-after-move.patch >new file mode 100644 >index 0000000000000000000000000000000000000000..db7ce41afe6d950aba603b6076de37b16f27b350 >--- /dev/null >+++ b/Source/ThirdParty/libwebrtc/WebKit/0013-Fix-SafeSetError-use-after-move.patch >@@ -0,0 +1,27 @@ >+diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.cc >+index 6281d57e3db..1bebb0509a1 100644 >+--- a/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.cc >++++ b/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.cc >+@@ -226,18 +226,19 @@ uint32_t ConvertIceTransportTypeToCandidateFilter( >+ } >+ >+ // Helper to set an error and return from a method. >+-bool SafeSetError(webrtc::RTCErrorType type, webrtc::RTCError* error) { >++static bool SafeSetError(webrtc::RTCErrorType type, webrtc::RTCError* error) { >+ if (error) { >+ error->set_type(type); >+ } >+ return type == webrtc::RTCErrorType::NONE; >+ } >+ >+-bool SafeSetError(webrtc::RTCError error, webrtc::RTCError* error_out) { >++static bool SafeSetError(webrtc::RTCError&& error, webrtc::RTCError* error_out) { >++ bool result = error.ok(); >+ if (error_out) { >+ *error_out = std::move(error); >+ } >+- return error.ok(); >++ return result; >+ } >+ >+ std::string GetSignalingStateString(
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188337
: 346609