Created attachment 544030 [details] [diff] [review] fixes w/o tests Free patch attached, needs tests. The bogus assertion is tripped by, e.g., $ echo "1 + 2" > /tmp/3.js $ ./DBG/js < /tmp/3.js and the buffer overrun is triggered by, e.g. (and this may be the only way), $ ./DBG/js -f /dev/zero Free fix to unsightly lack of vertical space in JS_InitStandardClasses included. Nick, can you add tests and land? /be
(In reply to comment #0) > Nick, can you add tests and land? Sure, thanks for finding.
Created attachment 544393 [details] [diff] [review] patch, v2 Same as Brendan's patch, but with an extra comment. I have no idea how to invoke these two commands with our testing scripts: js < foo.js js -f /dev/zero Waldo, do you know?
Make a C++ test using jsapi-tests? Or maybe add /dev/zero to a jstest.list for jstests?
Comment on attachment 544393 [details] [diff] [review] patch, v2 (In reply to comment #3) > Make a C++ test using jsapi-tests? Or maybe add /dev/zero to a jstest.list > for jstests? The latter doesn't work, because jstests.py requires the entries in jstest.list be relative paths. The former would work but seems overkill, and adds an extra .cpp file to builds. Brendan, I think the best option is to not bother testing. The |js < foo.js| case was a trivial incorrect assertion, and the |js -f /dev/zero| case could only happen with files that lied about their size; the only ones I know about like that are /dev/zero and /dev/random. What do you think?
Comment on attachment 544393 [details] [diff] [review] patch, v2 Ideally we'd use Python's noted ability to handle full pathnames, check for /dev/zero, etc., but it's not important right now. Thanks, /be