octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62963] webwrite() out of memory when a data c


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #62963] webwrite() out of memory when a data contains any '='
Date: Sat, 27 Aug 2022 10:45:30 -0400 (EDT)

Update of bug #62963 (project octave):

                  Status:                    None => Need Info              
                 Release:                   6.4.0 => dev                    
        Operating System:               GNU/Linux => Any                    

    _______________________________________________________

Follow-up Comment #1:

I don't know how to reproduce. But looking at the code, I think I understand
how that could be happening.

Does the following work as a work-around?

base64_data_2 = 'e1wibmFtZVwiLFwiMTIzNFwifQ==';
webwrite('http://192.168.56.4/product/add_product.cgi', 'data',
base64_data_2);


If it does, does the following change to your local `webwrite.m` also help
with the original commands?

diff -r 4c2b83516eb7 scripts/web/webwrite.m
--- a/scripts/web/webwrite.m    Fri Aug 26 22:30:43 2022 +0200
+++ b/scripts/web/webwrite.m    Sat Aug 27 16:44:13 2022 +0200
@@ -92,7 +92,12 @@
     error ("webwrite: DATA must be a string");
   elseif (nargs == 1)
     if (ischar (varargin{1}) && isrow (varargin{1}))
-      param = strsplit (varargin{1}, {"=", "&"});
+      param = regexp (varargin{1}, '([^=]*)=([^&]*)&?', 'tokens');
+      if isempty (param) || isempty (param{1}
+        error ("webwrite: DATA not a valid query string");
+      else
+        param = [param{:}];
+      endif
       response = __restful_service__ (url, param, options);
     elseif (! iscellstr (varargin))
       error ("webwrite: DATA must be a string");



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62963>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]