Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(289)

Issue 6210063: code review 6210063: go.crypto/ssh: fix panic unmarshalling channelOpenFailureMsg (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 5 months ago by dave
Modified:
14 years, 5 months ago
Reviewers:
CC:
agl1, kardia, gpaul, golang-dev
Visibility:
Public.

Description

go.crypto/ssh: fix panic unmarshalling channelOpenFailureMsg I introduced this problem in change set 33 when I redefined RejectionReason from a uint32 to an int. I have added a test to verify the message can be marshaled correctly. This was a bit hard to track down as the recover in clientConn mainLoop would catch the panic and shutdown the connection. We probably shouldn't be using panic inside marshal/unmarshal, at least not without a way to let the user know why the recover logic tripped.

Patch Set 1 #

Patch Set 2 : diff -r b24d6db9878e https://code.google.com/p/go.crypto #

Patch Set 3 : diff -r b24d6db9878e https://code.google.com/p/go.crypto #

Patch Set 4 : diff -r b24d6db9878e https://code.google.com/p/go.crypto #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -1 line) Patch
M ssh/channel.go View 1 1 chunk +1 line, -1 line 0 comments Download
M ssh/messages_test.go View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 6
dave_cheney.net
Hello agl@golang.org, kardianos@gmail.com, gustav.paul@gmail.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.crypto
14 years, 5 months ago (2012-05-17 02:19:00 UTC) #1
gpaul
LGTM. I stumbled across the panic -> drop connection logic recently when my code intermittently ...
14 years, 5 months ago (2012-05-17 05:17:24 UTC) #2
dave_cheney.net
Let's wait for agl. If we can find another way to avoid panic'ing on a ...
14 years, 5 months ago (2012-05-17 05:26:06 UTC) #3
agl1
LGTM. I added the recover because I felt bad adding lots of error checking to ...
14 years, 5 months ago (2012-05-17 14:25:24 UTC) #4
kardia
LGTM
14 years, 5 months ago (2012-05-17 18:31:17 UTC) #5
dave_cheney.net
14 years, 5 months ago (2012-05-17 23:11:39 UTC) #6
*** Submitted as
http://code.google.com/p/go/source/detail?r=4c6e8e7b2c2c&repo=crypto ***

go.crypto/ssh: fix panic unmarshalling channelOpenFailureMsg

I introduced this problem in change set 33 when I redefined
RejectionReason from a uint32 to an int. I have added a test
to verify the message can be marshaled correctly.

This was a bit hard to track down as the recover in clientConn
mainLoop would catch the panic and shutdown the connection. We
probably shouldn't be using panic inside marshal/unmarshal, at
least not without a way to let the user know why the recover
logic tripped.

R=agl, kardianos, gustav.paul
CC=golang-dev
http://codereview.appspot.com/6210063
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b