1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-05 16:26:17 +00:00

Merge pull request #800 from marler8997/fixUbInGC

add NULL check in gc.c to avoid UB
This commit is contained in:
Calvin Rose 2021-09-14 16:04:12 -05:00 committed by GitHub
commit 92c02449f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,6 +123,8 @@ static void janet_mark_abstract(void *adata) {
/* Mark a bunch of items in memory */
static void janet_mark_many(const Janet *values, int32_t n) {
if (values == NULL)
return;
const Janet *end = values + n;
while (values < end) {
janet_mark(*values);