Skip to content

Commit

Permalink
Ensure not creating a worker with non-existing module
Browse files Browse the repository at this point in the history
  • Loading branch information
renatahodovan committed Jul 23, 2024
1 parent 012451d commit ab2c449
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quickjs-libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3466,7 +3466,8 @@ static JSValue js_worker_ctor(JSContext *ctx, JSValueConst new_target,

/* module name */
filename = JS_ToCString(ctx, argv[0]);
if (!filename)
struct stat buffer;
if (!filename || stat(filename, &buffer) != 0)
goto fail;

args = malloc(sizeof(*args));
Expand Down

0 comments on commit ab2c449

Please sign in to comment.