Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/rpc/jsonrpc: fails to ignore invalid object parameters #3717

Closed
gopherbot opened this issue Jun 9, 2012 · 7 comments
Closed

net/rpc/jsonrpc: fails to ignore invalid object parameters #3717

gopherbot opened this issue Jun 9, 2012 · 7 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 9, 2012

by ThoughtMonster:

Given a simple JSON-RPC server in http://play.golang.org/p/S9vSE6lVFR, requests fail
with "rpc: JSON decoder out of sync - data changing underfoot?" when given a
JSON-RPC request like the following:

{"jsonrpc":"2.0","method":"Server.Echo","params":["article",{"category":1}],"id":"1"}

To reproduce, connect to the server via telnet and echo the above string.

In this case, it seems that jsonrpc is not ignoring the additional object parameter,
which leads to the above issue.

GDB tells me that the error is reached in decode.go:383.

Using go version 1.0.1, on ArchLinux x86-64, using the 6g compiler.
@rsc
Copy link
Contributor

@rsc rsc commented Sep 12, 2012

Comment 1:

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

@rsc rsc commented Sep 12, 2012

Comment 2:

Labels changed: added go1.1.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 10, 2012

Comment 3:

Labels changed: added size-m.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 10, 2012

Comment 4:

Labels changed: added suggested.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 12, 2013

Comment 5 by rickarnoldjr:

https://golang.org/cl/7490046/
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 12, 2013

Comment 6 by robryk:

A reduced test case is in http://play.golang.org/p/OYCGWFzZGp
The problem seems to appear only when the last element in a JSON array is an object, and
is ignored.
@rsc
Copy link
Contributor

@rsc rsc commented Mar 13, 2013

Comment 7:

This issue was closed by revision cb8aebf.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.