jackxiao / jslibs

Automatically exported from code.google.com/p/jslibs
0 stars 0 forks source link

crash in std:Buffer class #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
test case:
  var b = new Buffer();
  var s = b.Read(4);
  b.Unread(s);
  b.ReadUntil('a');

Original issue reported on code.google.com by sou...@gmail.com on 19 Nov 2007 at 12:54

GoogleCodeExporter commented 9 years ago
another test case:
  var b = new Buffer();
  var s = b.Read(1);
  Print( s );

Crash always occurs in JS_GetStringBytes function.
It seems that buffer.cpp:ReadAmount function do not the \0 at the right place.

Original comment by sou...@gmail.com on 19 Nov 2007 at 1:20

GoogleCodeExporter commented 9 years ago
add '\0' at the end of the buffer

Original comment by sou...@gmail.com on 28 Nov 2007 at 11:06