Commit 9d0676e7 authored by harshad's avatar harshad

fix for buffer limit in loading string

parent b0f37f22
...@@ -422,7 +422,7 @@ func decodeStringEscape(b []byte) string { ...@@ -422,7 +422,7 @@ func decodeStringEscape(b []byte) string {
// Push a string // Push a string
func (d *Decoder) loadString() error { func (d *Decoder) loadString() error {
line, _, err := d.r.ReadLine() line, err := d.r.ReadBytes('\n')
if err != nil { if err != nil {
return err return err
} }
...@@ -437,11 +437,11 @@ func (d *Decoder) loadString() error { ...@@ -437,11 +437,11 @@ func (d *Decoder) loadString() error {
return fmt.Errorf("invalid string delimiter: %c", line[0]) return fmt.Errorf("invalid string delimiter: %c", line[0])
} }
if line[len(line)-1] != delim { if line[len(line)-2] != delim {
return fmt.Errorf("insecure string") return fmt.Errorf("insecure string")
} }
d.push(decodeStringEscape(line[1 : len(line)-1])) d.push(decodeStringEscape(line[1 : len(line)-2]))
return nil return nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment