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

Go panics on some malformed templates #2

Closed
peterbourgon opened this issue Feb 12, 2010 · 2 comments
Closed

Go panics on some malformed templates #2

peterbourgon opened this issue Feb 12, 2010 · 2 comments

Comments

@peterbourgon
Copy link

I tried creating a template with {{}} in an {{#enumerated_section}} and mustache.go threw a string bounds panic (full dump below). I see a number of explicit panic() calls in mustache.go so maybe this is not undesired behavior.

PC=0x14b7f index 0<0>0
throw: string bounds

panic PC=0x8a6ec0
throw+0x3e /Users/peter/Code/go/src/pkg/runtime/runtime.c:74
throw(0xe11d8, 0x0)
prbounds+0x92 /Users/peter/Code/go/src/pkg/runtime/string.c:108
prbounds(0xe11f8, 0x0, 0x0, 0x0, 0x0, ...)
runtime.indexstring+0x82 /Users/peter/Code/go/src/pkg/runtime/string.c:214
runtime.indexstring(0x7c71a, 0x0, 0x0, 0x0, 0x0, ...)
mustache.*template·parseSection+0x368 /Users/peter/Code/mustache.go/mustache.go:145
mustache.*template·parseSection(0x127e640, 0x0, 0x9613a0, 0x0, 0x7c6d1, ...)
mustache.*template·parse+0x439 /Users/peter/Code/mustache.go/mustache.go:192
mustache.*template·parse(0x127e640, 0x0, 0x12750f0, 0x0)
mustache.ParseString+0xc2 /Users/peter/Code/mustache.go/mustache.go:316
mustache.ParseString(0x7c548, 0x0, 0x296, 0x0, 0xb0e78, ...)
mustache.Render+0x25 /Users/peter/Code/mustache.go/mustache.go:345
mustache.Render(0x7c548, 0x0, 0x296, 0x0, 0xb0e78, ...)
@hoisie
Copy link
Owner

hoisie commented Feb 12, 2010

Awesome, thanks for the report, just fixed it.

@hoisie
Copy link
Owner

hoisie commented Apr 19, 2010

Closing.

marksalpeter pushed a commit to dealyze/mustache that referenced this issue Mar 9, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants