RESOLVED FIXED 46279
Random plug-in cleanups
https://bugs.webkit.org/show_bug.cgi?id=46279
Summary Random plug-in cleanups
Anders Carlsson
Reported 2010-09-22 10:58:34 PDT
Random plug-in cleanups
Attachments
Patch (5.51 KB, patch)
2010-09-22 11:00 PDT, Anders Carlsson
darin: review+
Anders Carlsson
Comment 1 2010-09-22 11:00:35 PDT
WebKit Review Bot
Comment 2 2010-09-22 11:04:20 PDT
Attachment 68395 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebKit2/WebProcess/Plugins/Plugin.h:37: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 3 2010-09-22 11:05:46 PDT
Comment on attachment 68395 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=68395&action=review > WebKit2/WebProcess/Plugins/Plugin.cpp:48 > + parameters.url = KURL(ParsedURLString, urlString); Are you sure this is the constructor we want to use here? This is normally only suitable if we know that the URL is already parsed by KURL and the string came out of KURL. Is that going to be true. Further, is this consistent with the “don’t trust the other process” philosophy? > WebKit2/WebProcess/Plugins/Plugin.cpp:57 > + if (!decoder->decode(parameters.names)) > + return false; > + if (!decoder->decode(parameters.values)) > + return false; > + if (!decoder->decode(parameters.mimeType)) > + return false; > + if (!decoder->decode(parameters.loadManually)) > + return false; Do these functions normally check for validity? For example, are the names and values arrays the same length? Are they all strings in those arrays? Are there any invalid values for anything?
Anders Carlsson
Comment 4 2010-09-22 11:12:39 PDT
(In reply to comment #3) > (From update of attachment 68395 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=68395&action=review > > > WebKit2/WebProcess/Plugins/Plugin.cpp:48 > > + parameters.url = KURL(ParsedURLString, urlString); > > Are you sure this is the constructor we want to use here? This is normally only suitable if we know that the URL is already parsed by KURL and the string came out of KURL. Is that going to be true. Further, is this consistent with the “don’t trust the other process” philosophy? > I hadn't thought about the possibility that the URLs might be invalid because they came from a compromised web process. I think the best way to solve this is to add an argument coder for KURL which checks that the URLs are valid, and I'll do this in a followup patch. > > WebKit2/WebProcess/Plugins/Plugin.cpp:57 > > + if (!decoder->decode(parameters.names)) > > + return false; > > + if (!decoder->decode(parameters.values)) > > + return false; > > + if (!decoder->decode(parameters.mimeType)) > > + return false; > > + if (!decoder->decode(parameters.loadManually)) > > + return false; > > Do these functions normally check for validity? For example, are the names and values arrays the same length? Are they all strings in those arrays? Are there any invalid values for anything? They check that the strings are valid, but not that the number of names matches the number of values. I'll fix that.
Anders Carlsson
Comment 5 2010-09-22 11:16:37 PDT
Note You need to log in before you can comment on or make changes to this bug.