Skip to content

Commit

Permalink
lj_audit.log.c: Fix iteration through trace constants
Browse files Browse the repository at this point in the history
Fix the loop that iterates through trace constants by skipping over
inline data. This data (64-bit constant values) could otherwise be
interpreted as IR constants and dereferenced to find strings, etc.
That's invalid and would cause segfaults and bus errors.
  • Loading branch information
lukego committed Apr 26, 2018
1 parent fe5f37d commit 1646db3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lj_auditlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ static void log_GCtrace(GCtrace *T)
break;
}
}
if (irt_is64(ir->t) && ir->o != IR_KNULL) {
/* Skip over 64-bit inline operand for this instruction. */
ref++;
}
}
log_mem("GCtrace", T, sizeof(*T));
}
Expand Down

0 comments on commit 1646db3

Please sign in to comment.