Skip to content

Commit

Permalink
Merge pull request janet-lang#976 from rick2600/master
Browse files Browse the repository at this point in the history
Fix janet-lang#975 - null ptr dereference when a table is created with negative capacity
  • Loading branch information
bakpakin authored May 5, 2022
2 parents 0395a03 + 1ff5216 commit a9d4d2b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ JANET_CORE_FN(cfun_table_new,
"can be avoided. Returns the new table.") {
janet_fixarity(argc, 1);
int32_t cap = janet_getinteger(argv, 0);
if (cap < 0) janet_panic("expected positive integer");
return janet_wrap_table(janet_table(cap));
}

Expand Down

0 comments on commit a9d4d2b

Please sign in to comment.