missing bounds check
Russ Ross russ@russross.com
Sun, 03 Jul 2011 10:30:28 -0600
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
inline.go
→
inline.go
@@ -667,14 +667,14 @@ for i < len(data) && (isalnum(data[i]) || data[i] == '.' || data[i] == '+' || data[i] == '-') {
i++ } - if i > 1 && data[i] == '@' { + if i > 1 && i < len(data) && data[i] == '@' { if j = isMailtoAutoLink(data[i:]); j != 0 { *autolink = LINK_TYPE_EMAIL return i + j } } - if i > 2 && data[i] == ':' { + if i > 2 && i < len(data) && data[i] == ':' { *autolink = LINK_TYPE_NORMAL i++ }