WebKit Bugzilla
Attachment 372609 Details for
Bug 199097
: Make sure to check for file descriptor value before using FD_CLR
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199097-20190620191237.patch (text/plain), 3.93 KB, created by
youenn fablet
on 2019-06-20 19:12:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-06-20 19:12:37 PDT
Size:
3.93 KB
patch
obsolete
>Subversion Revision: 246549 >diff --git a/Source/ThirdParty/libwebrtc/ChangeLog b/Source/ThirdParty/libwebrtc/ChangeLog >index 66a602792789c2b2e727768133a3c09a11190d0e..ce9e815d8fdd600ed019f57dfed4e219f76ca0ee 100644 >--- a/Source/ThirdParty/libwebrtc/ChangeLog >+++ b/Source/ThirdParty/libwebrtc/ChangeLog >@@ -1,3 +1,14 @@ >+2019-06-20 Youenn Fablet <youenn@apple.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ * Source/webrtc/rtc_base/physicalsocketserver.cc: >+ * WebKit/0001-fix-fd-clr.patch: Added. >+ > 2019-06-12 Youenn Fablet <youenn@apple.com> > > Make sure libwebrtc ObjC codec interfaces do not conflict >diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/physicalsocketserver.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/physicalsocketserver.cc >index 91cb7da8366e2f1dfca360c57881f9707e54e008..3cf2d3221c5fa83f0b69e4ffa51869765b55147a 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); >diff --git a/Source/ThirdParty/libwebrtc/WebKit/0001-fix-fd-clr.patch b/Source/ThirdParty/libwebrtc/WebKit/0001-fix-fd-clr.patch >new file mode 100644 >index 0000000000000000000000000000000000000000..79e42be65756525449fa8ee997c9b8f93facda21 >--- /dev/null >+++ b/Source/ThirdParty/libwebrtc/WebKit/0001-fix-fd-clr.patch >@@ -0,0 +1,39 @@ >+From ce3b5d0dd003a502922ef1bb34a0935dd9fa26a9 Mon Sep 17 00:00:00 2001 >+From: Youenn Fablet <youenn@apple.com> >+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) >+
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 199097
: 372609