[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:49:04 -0400 (EDT) |
Follow-up Comment #2, bug #62963 (project octave):
Oops. Typo in the diff. That should have been:
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:47:52 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/