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

Issue 4432089: code review 4432089: net: don't crash on unexpected DNS SRV responses (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by bradfitz
Modified:
12 years, 11 months ago
Reviewers:
CC:
rsc, bradfitzgoog, golang-dev
Visibility:
Public.

Description

net: don't crash on unexpected DNS SRV responses Fixes issue 1350

Patch Set 1 #

Patch Set 2 : diff -r bc5f123ece35 https://go.googlecode.com/hg #

Patch Set 3 : diff -r bc5f123ece35 https://go.googlecode.com/hg #

Patch Set 4 : diff -r bc5f123ece35 https://go.googlecode.com/hg #

Patch Set 5 : diff -r bc5f123ece35 https://go.googlecode.com/hg #

Patch Set 6 : diff -r bc5f123ece35 https://go.googlecode.com/hg #

Patch Set 7 : diff -r bc5f123ece35 https://go.googlecode.com/hg #

Patch Set 8 : diff -r bc5f123ece35 https://go.googlecode.com/hg #

Patch Set 9 : diff -r bc5f123ece35 https://go.googlecode.com/hg #

Total comments: 2

Patch Set 10 : diff -r b2670a39da7c https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -26 lines) Patch
M src/pkg/net/dnsclient.go View 1 2 3 4 5 6 7 8 9 5 chunks +14 lines, -14 lines 0 comments Download
M src/pkg/net/dnsmsg.go View 1 2 3 4 5 6 7 8 9 1 chunk +23 lines, -12 lines 0 comments Download
A src/pkg/net/dnsmsg_test.go View 1 2 3 4 5 6 7 8 1 chunk +100 lines, -0 lines 0 comments Download

Messages

Total messages: 20
bradfitz
Hello rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg
12 years, 11 months ago (2011-05-02 21:36:18 UTC) #1
rsc
There are others in this file.
12 years, 11 months ago (2011-05-02 21:38:45 UTC) #2
bradfitz
Oh, indeed. And other bugs: if len(rr) >= 0 { cname = rr[0].(*dnsRR_CNAME).Cname } On ...
12 years, 11 months ago (2011-05-02 21:40:34 UTC) #3
rsc
actually hang on func answer in dnsclient.go only returns dnsRR that have the given qtype. ...
12 years, 11 months ago (2011-05-02 21:44:15 UTC) #4
bradfitz
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 11 months ago (2011-05-02 21:46:35 UTC) #5
bradfitzgoog
looking. I was just going off the stack trace in the bug. On Mon, May ...
12 years, 11 months ago (2011-05-02 21:48:17 UTC) #6
rsc
weird. that trace would happen if the map lookup failed in // make an rr ...
12 years, 11 months ago (2011-05-02 22:01:32 UTC) #7
bradfitz
But if unpackRR returns false: dns.answer = make([]dnsRR, dh.Ancount) ... for i := 0; i ...
12 years, 11 months ago (2011-05-02 22:04:50 UTC) #8
rsc
On Mon, May 2, 2011 at 18:04, Brad Fitzpatrick <bradfitz@golang.org> wrote: > But if unpackRR ...
12 years, 11 months ago (2011-05-02 22:19:27 UTC) #9
bradfitz
Hello rsc, bradfitzwork (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 11 months ago (2011-05-02 22:19:37 UTC) #10
rsc
I like the range loops but don't want to put the interface checks in until ...
12 years, 11 months ago (2011-05-02 22:21:43 UTC) #11
bradfitz
Hello rsc, bradfitzwork (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 11 months ago (2011-05-02 22:44:37 UTC) #12
bradfitz
This CL's mostly paranoia (some unnecessary) and append cleanup, but my leading theory for the ...
12 years, 11 months ago (2011-05-02 22:50:50 UTC) #13
bradfitz
Theory confirmed. CL updated with a failing test: http://codereview.appspot.com/4432089/diff/4005/src/pkg/net/dnsmsg_test.go === RUN net.TestDNSParseSRVReply --- PASS: net.TestDNSParseSRVReply ...
12 years, 11 months ago (2011-05-02 23:22:38 UTC) #14
rsc
Cool lets just not return the Headers in the rr list. Then the assertions are ...
12 years, 11 months ago (2011-05-02 23:27:05 UTC) #15
bradfitz
Agreed. Patching up answer() and tests now, reverting comma-ok changes. On Mon, May 2, 2011 ...
12 years, 11 months ago (2011-05-02 23:35:51 UTC) #16
bradfitz
Hello rsc, bradfitzwork (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 11 months ago (2011-05-02 23:52:26 UTC) #17
rsc
LGTM http://codereview.appspot.com/4432089/diff/8003/src/pkg/net/dnsclient.go File src/pkg/net/dnsclient.go (right): http://codereview.appspot.com/4432089/diff/8003/src/pkg/net/dnsclient.go#newcode389 src/pkg/net/dnsclient.go:389: if len(rr) == 0 { can't happen http://codereview.appspot.com/4432089/diff/8003/src/pkg/net/dnsmsg.go ...
12 years, 11 months ago (2011-05-03 03:06:52 UTC) #18
bradfitz
Hello rsc, bradfitzwork (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 11 months ago (2011-05-03 14:10:38 UTC) #19
bradfitz
12 years, 11 months ago (2011-05-03 14:11:02 UTC) #20
*** Submitted as http://code.google.com/p/go/source/detail?r=05140e700807 ***

net: don't crash on unexpected DNS SRV responses

Fixes issue 1350

R=rsc, bradfitzwork
CC=golang-dev
http://codereview.appspot.com/4432089
Sign in to reply to this message.

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