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

Issue 7712050: text/template: Fix nil pointer dereference (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by Hierro
Modified:
11 years, 1 month ago
Reviewers:
r, bradfitz, dave, golang-dev
Visibility:
Public.

Description

text/template: Fix nil pointer dereference Handle *parse.IdentifierNode in evalArg(). This bug happens when evaluating a field or method on an object returned from a template function (e.g. {{ MyFunction.Field1 }}))

Patch Set 1 #

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -0 lines) Patch
src/pkg/text/template/exec.go View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 14
bradfitz
Please add a test.
11 years, 1 month ago (2013-03-22 15:55:29 UTC) #1
r
NOT LGTM This is a can of worms that has been opened and closed multiple ...
11 years, 1 month ago (2013-03-22 16:33:52 UTC) #2
Hierro
To make things more clear, I've written this test: package template import ( "bytes" "testing" ...
11 years, 1 month ago (2013-03-27 16:18:42 UTC) #3
r
As I said before, you may have a crash and there is clearly a bug ...
11 years, 1 month ago (2013-03-27 17:03:03 UTC) #4
Hierro
Hi Rob, Could you please clarify why using "call" is required? I was under the ...
11 years, 1 month ago (2013-03-27 18:48:06 UTC) #5
r
https://codereview.appspot.com/7861046 shows the way. You need parentheses to chain a function call. -rob
11 years, 1 month ago (2013-03-27 20:03:05 UTC) #6
r
Also see issue 3999. -rob
11 years, 1 month ago (2013-03-27 20:03:40 UTC) #7
r
On a tangential note, you need to start checking the error returns from template.Execute. -rob
11 years, 1 month ago (2013-03-27 20:11:21 UTC) #8
r
The use of templates is incorrect, but there is a bug in the template package, ...
11 years, 1 month ago (2013-03-27 20:14:42 UTC) #9
Hierro
On 2013/03/27 20:11:21, r wrote: > On a tangential note, you need to start checking ...
11 years, 1 month ago (2013-03-27 21:00:22 UTC) #10
Hierro
> To avoid ambiguity in execution, in a function invocation starting a > field chain, ...
11 years, 1 month ago (2013-03-27 21:05:17 UTC) #11
Hierro
On 2013/03/27 20:03:40, r wrote: > Also see issue 3999. > > -rob https://codereview.appspot.com/3999/ says ...
11 years, 1 month ago (2013-03-27 21:10:58 UTC) #12
dave_cheney.net
Try golang.org/issue/3999 On 28/03/2013, at 8:10, alberto.garcia.hierro@gmail.com wrote: > On 2013/03/27 20:03:40, r wrote: >> ...
11 years, 1 month ago (2013-03-27 21:13:13 UTC) #13
Hierro
11 years, 1 month ago (2013-03-27 21:27:07 UTC) #14
On 2013/03/27 21:13:13, dfc wrote:
> Try golang.org/issue/3999

Thanks!
Sign in to reply to this message.

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