Skip to content

Commit

Permalink
Limit word names to 64 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed Jan 28, 2025
1 parent c5f3ea2 commit f6e9852
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/samples/forthsalon/forth.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ static struct forth_word *new_word(struct forth_ctx *ctx,
void *callback,
bool compiler)
{
if (len > 64)
return NULL;

struct forth_word *word = malloc(sizeof(*word) + len + 1);
if (UNLIKELY(!word))
return NULL;
Expand Down

0 comments on commit f6e9852

Please sign in to comment.