Closed Bug 984595 Opened 10 years ago Closed 9 years ago

Null reference on TCPSocket.bufferedAmount in navigator.mozTCPSocket

Categories

(Core :: DOM: Device Interfaces, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 885982

People

(Reporter: ato, Unassigned)

Details

Attachments

(1 file, 2 obsolete files)

The bufferedAmount read-only property on the TCPSocket object that populates navigator.mozTCPSocket by default triggers a null pointer exception in JS when called as such:

    navigator.mozTCPSocket.bufferedAmount

Stacktrace:

JavaScript Error: "this._multiplexStream is null" {file: "jar:file:///system/b2g/omni.ja!/components/TCPSocket.js" line: 197}]' when calling method: [nsIDOMTCPSocket::bufferedAmount]" nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"

This is problematic when marshalling or inspecting the object.
Assignee: nobody → ato
Status: NEW → ASSIGNED
Attaching a patch which fixes the problem, but I'm unsure what the default return value of the bufferedAmount property should be.  I've assumed it's meant to be 0.

I'm also unsure if this is the right way to solve the problem, so feedback is very welcome!
Attachment #8392523 - Flags: review?(josh)
Oops, uploaded wrong .patch file.
Attachment #8392523 - Attachment is obsolete: true
Attachment #8392523 - Flags: review?(josh)
Attachment #8392526 - Flags: review?(josh)
Attachment #8392526 - Attachment is obsolete: true
Attachment #8392526 - Flags: review?(josh)
Attachment #8392527 - Flags: review?(josh)
Comment on attachment 8392527 [details] [diff] [review]
0001-Bug-984595-Fix-null-reference-on-TCPSocket.bufferedA.patch

This will likely be fixed by bug 885982, so cancelling review for now.  Will revisit and check that it does when that bug lands and take appropriate action then.
Attachment #8392527 - Flags: review?(josh)
Assignee: ato → nobody
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: