File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -451,6 +451,11 @@ JS_FUNCTION(fs_read_dir) {
451451static jerry_value_t stats_is_typeof (jerry_value_t stats , int type ) {
452452 jerry_value_t mode = iotjs_jval_get_property (stats , IOTJS_MAGIC_STRING_MODE );
453453
454+ if (!jerry_value_is_number (mode )) {
455+ jerry_release_value (mode );
456+ return JS_CREATE_ERROR (TYPE , "fstat: file mode should be a number" );
457+ }
458+
454459 int mode_number = (int )iotjs_jval_as_number (mode );
455460
456461 jerry_release_value (mode );
Original file line number Diff line number Diff line change 1+ /* Copyright 2019-present Samsung Electronics Co., Ltd. and other contributors
2+ *
3+ * Licensed under the Apache License, Version 2.0 (the "License");
4+ * you may not use this file except in compliance with the License.
5+ * You may obtain a copy of the License at
6+ *
7+ * http://www.apache.org/licenses/LICENSE-2.0
8+ *
9+ * Unless required by applicable law or agreed to in writing, software
10+ * distributed under the License is distributed on an "AS IS" BASIS
11+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ * See the License for the specific language governing permissions and
13+ * limitations under the License.
14+ */
15+
16+ var fs = require ( 'fs' )
17+ setInterval ( fs . fstatSync ( 1 ) . isFile , 1 ) ;
Original file line number Diff line number Diff line change 11111111 {
11121112 "name" : " test_timers_issue_1353.js" ,
11131113 "expected-failure" : true
1114+ },
1115+ {
1116+ "name" : " test-issue-1917.js" ,
1117+ "expected-failure" : true ,
1118+ "required-modules" : [
1119+ " fs"
1120+ ]
11141121 }
11151122 ],
11161123 "node/parallel" : [
You can’t perform that action at this time.
0 commit comments