Title: [246682] trunk/Source/ThirdParty/libwebrtc
- Revision
- 246682
- Author
- [email protected]
- Date
- 2019-06-21 10:12:36 -0700 (Fri, 21 Jun 2019)
Log Message
Make sure to check for file descriptor value before using FD_CLR
https://bugs.webkit.org/show_bug.cgi?id=199097
<rdar://problem/51479074>
Reviewed by Eric Carlson.
* Source/webrtc/rtc_base/physicalsocketserver.cc:
* WebKit/0001-fix-fd-clr.patch: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (246681 => 246682)
--- trunk/Source/ThirdParty/libwebrtc/ChangeLog 2019-06-21 16:59:15 UTC (rev 246681)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog 2019-06-21 17:12:36 UTC (rev 246682)
@@ -1,3 +1,14 @@
+2019-06-21 Youenn Fablet <[email protected]>
+
+ Make sure to check for file descriptor value before using FD_CLR
+ https://bugs.webkit.org/show_bug.cgi?id=199097
+ <rdar://problem/51479074>
+
+ Reviewed by Eric Carlson.
+
+ * Source/webrtc/rtc_base/physicalsocketserver.cc:
+ * WebKit/0001-fix-fd-clr.patch: Added.
+
2019-06-12 Youenn Fablet <[email protected]>
Make sure libwebrtc ObjC codec interfaces do not conflict
Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/physicalsocketserver.cc (246681 => 246682)
--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/physicalsocketserver.cc 2019-06-21 16:59:15 UTC (rev 246681)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/physicalsocketserver.cc 2019-06-21 17:12:36 UTC (rev 246682)
@@ -1424,8 +1424,10 @@
// "select"ing a file descriptor that is equal to or larger than
// FD_SETSIZE will result in undefined behavior.
RTC_DCHECK_LT(fd, FD_SETSIZE);
+#if defined(WEBRTC_WEBKIT_BUILD)
if (fd < 0 || fd >= FD_SETSIZE)
continue;
+#endif
if (fd > fdmax)
fdmax = fd;
@@ -1462,7 +1464,10 @@
processing_dispatchers_ = true;
for (Dispatcher* pdispatcher : dispatchers_) {
int fd = pdispatcher->GetDescriptor();
-
+#if defined(WEBRTC_WEBKIT_BUILD)
+ if (fd < 0 || fd >= FD_SETSIZE)
+ continue;
+#endif
bool readable = FD_ISSET(fd, &fdsRead);
if (readable) {
FD_CLR(fd, &fdsRead);
Added: trunk/Source/ThirdParty/libwebrtc/WebKit/0001-fix-fd-clr.patch (0 => 246682)
--- trunk/Source/ThirdParty/libwebrtc/WebKit/0001-fix-fd-clr.patch (rev 0)
+++ trunk/Source/ThirdParty/libwebrtc/WebKit/0001-fix-fd-clr.patch 2019-06-21 17:12:36 UTC (rev 246682)
@@ -0,0 +1,39 @@
+From ce3b5d0dd003a502922ef1bb34a0935dd9fa26a9 Mon Sep 17 00:00:00 2001
+From: Youenn Fablet <[email protected]>
+Date: Thu, 20 Jun 2019 19:09:59 -0700
+Subject: [PATCH] fix-fd-clr
+
+---
+ .../Source/webrtc/rtc_base/physicalsocketserver.cc | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/physicalsocketserver.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/physicalsocketserver.cc
+index 91cb7da8366..3cf2d3221c5 100644
+--- a/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/physicalsocketserver.cc
++++ b/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/physicalsocketserver.cc
+@@ -1424,8 +1424,10 @@ bool PhysicalSocketServer::WaitSelect(int cmsWait, bool process_io) {
+ // "select"ing a file descriptor that is equal to or larger than
+ // FD_SETSIZE will result in undefined behavior.
+ RTC_DCHECK_LT(fd, FD_SETSIZE);
++#if defined(WEBRTC_WEBKIT_BUILD)
+ if (fd < 0 || fd >= FD_SETSIZE)
+ continue;
++#endif
+ if (fd > fdmax)
+ fdmax = fd;
+
+@@ -1462,7 +1464,10 @@ bool PhysicalSocketServer::WaitSelect(int cmsWait, bool process_io) {
+ processing_dispatchers_ = true;
+ for (Dispatcher* pdispatcher : dispatchers_) {
+ int fd = pdispatcher->GetDescriptor();
+-
++#if defined(WEBRTC_WEBKIT_BUILD)
++ if (fd < 0 || fd >= FD_SETSIZE)
++ continue;
++#endif
+ bool readable = FD_ISSET(fd, &fdsRead);
+ if (readable) {
+ FD_CLR(fd, &fdsRead);
+--
+2.21.0 (Apple Git-118)
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes