Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Issue 2876046: Prevent invalid pre-parsing data passed in through the API from crashing V8. (Closed)

Created:
10 years, 5 months ago by William Hesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Prevent invalid pre-parsing data passed in through the API from crashing V8. Committed: http://code.google.com/p/v8/source/detail?r=5030

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 3

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -2 lines) Patch
M src/messages.js View 2 1 chunk +2 lines, -1 line 0 comments Download
M src/parser.cc View 1 2 3 4 5 3 chunks +17 lines, -0 lines 0 comments Download
M test/cctest/test-api.cc View 2 3 1 chunk +37 lines, -0 lines 0 comments Download
M test/mjsunit/fuzz-natives.js View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
William Hesse
Should we make a unit test using the API to send bad data?
10 years, 5 months ago (2010-07-06 09:37:05 UTC) #1
Kevin Millikin (Chromium)
http://codereview.chromium.org/2876046/diff/1/2 File src/parser.cc (right): http://codereview.chromium.org/2876046/diff/1/2#newcode3814 src/parser.cc:3814: ReportMessage("invalid preparser data", Vector<const char*>::empty()); Drive by: don't you ...
10 years, 5 months ago (2010-07-06 09:48:00 UTC) #2
Kasper Lund
Please add a test case in test-api.cc that checks that you get the right kind ...
10 years, 5 months ago (2010-07-06 09:53:11 UTC) #3
William Hesse
Comments addressed. The unit test is hard to write cleanly because we don't have access ...
10 years, 5 months ago (2010-07-07 08:31:29 UTC) #4
Kasper Lund
10 years, 5 months ago (2010-07-07 09:59:49 UTC) #5
LGTM.

http://codereview.chromium.org/2876046/diff/19001/20002
File src/parser.cc (right):

http://codereview.chromium.org/2876046/diff/19001/20002#newcode137
src/parser.cc:137: void ReportInvalidPreparseData(Handle<String> name, bool
*ok);
bool *ok => bool* ok

http://codereview.chromium.org/2876046/diff/19001/20003
File test/cctest/test-api.cc (right):

http://codereview.chromium.org/2876046/diff/19001/20003#newcode8571
test/cctest/test-api.cc:8571: // ScriptDataImpl private implementation details
I agree that this is not pretty, but it's much better than no testing. Thanks.
Feel free to clean it up in a separate CL.

http://codereview.chromium.org/2876046/diff/19001/20003#newcode8591
test/cctest/test-api.cc:8591: compiled_script = Script::New(source, NULL, sd);
You should really be running the compiled script and/or catching the exception
here. Please make sure you get the right exception.

Powered by Google App Engine
This is Rietveld 408576698