[bug] URL decodedFields causes ArgumentOutOfRange exception

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug] URL decodedFields causes ArgumentOutOfRange exception

Nikita Kalinin
Issue status update for
http://smalltalk.gnu.org/node/863
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/863

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    NetClients
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  nixo
 Updated by:   nixo
 Status:       active

*Description*


url := URL fromString: '?key=value'.
fields := url decodedFields.
fields printNl.


Object: 'key=value' error: Invalid argument 0: argument must be between
4 and 9
SystemExceptions.ArgumentOutOfRange(Smalltalk.Exception)>>signal
(ExcHandling.st:254)
SystemExceptions.ArgumentOutOfRange(Smalltalk.Exception)>>signal:
(ExcHandling.st:264)
SystemExceptions.ArgumentOutOfRange class>>signalOn:mustBeBetween:and:
(SysExcept.st:599)
Smalltalk.String(Smalltalk.ArrayedCollection)>>copyFrom:to:
(ArrayColl.st:230)
[] in URL>>decodedFields (URL.st:535)
Smalltalk.OrderedCollection>>do: (OrderColl.st:68)
URL>>decodedFields (URL.st:541)
Smalltalk.UndefinedObject>>executeStatements (test.st:3)
nil

It seems to be a typo in this method. The size of 'key=value' is needed
when extracting the 'value':


keyValue size
But found:


value size
So after fixing:


LookupTable (
        'key'->'value'
)


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] URL decodedFields causes ArgumentOutOfRange exception

Holger Hans Peter Freyther-3
Issue status update for
http://smalltalk.gnu.org/project/issue/863
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/863

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    NetClients
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  nixo
 Updated by:   zecke
 Status:       active

Hi!

ah, your patch wasn't sent to the mailinglist and I came up with the
same patch. I am going to include a fix later today.



_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk