Closed Bug 1180025 Opened 9 years ago Closed 3 years ago

NPN_PostURLNotify have 1024 byte header limit which is too small

Categories

(Core Graveyard :: Plug-ins, defect)

38 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ibragimovrinat, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.0.1
Build ID: 20150526223604

Steps to reproduce:

Send a POST request with NPN_PostURLNotify() with custom headers of total length larger than 1024.


Actual results:

Firefox thinks there's no custom headers, sending file content as a request body. It also puts "Content-length: 1024" regardless of actual request length.


Expected results:

Firefox honors custom headers.
Component: Untriaged → Plug-ins
Product: Firefox → Core
To make clear what I'm talking about, here is a sample patch:

------ cut ------
--- a/dom/plugins/base/nsPluginHost.cpp	2015-05-26 00:28:50.000000000 +0300
+++ b/dom/plugins/base/nsPluginHost.cpp	2015-07-02 23:50:23.790305831 +0300
@@ -3663,12 +3663,12 @@
     if (NS_FAILED(rv))
       return rv;
 
-    char buf[1024];
+    char buf[8192];
     uint32_t br, bw;
     bool firstRead = true;
     while (1) {
       // Read() mallocs if buffer is null
-      rv = inStream->Read(buf, 1024, &br);
+      rv = inStream->Read(buf, sizeof(buf), &br);
       if (NS_FAILED(rv) || (int32_t)br <= 0)
         break;
       if (firstRead) {
------ cut ------


Buffer size is still hardcoded, but 8192 bytes is large enough I hope.
Resolving as wont fix, plugin support deprecated in Firefox 85.
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.