From 3a3014f9a397d61da731bc046efccf82c8f3a6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Mon, 10 Jun 2024 00:41:11 +0500 Subject: [PATCH] Fix segfault --- src/process.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/process.c b/src/process.c index fa83dd3..2881a35 100644 --- a/src/process.c +++ b/src/process.c @@ -31,7 +31,9 @@ bool process_find(tSyntaxElement* tree, tProcessingData** p_pdata) { tProcessingData* pd = *p_pdata; bool deffound = false; if (se_istraversable(tree)) - if (tree->content.syntax->type == TOKEN && tree->content.syntax->next != NULL) { + if (tree->content.syntax->type == TOKEN && + tree->content.syntax->next != NULL && + tree->content.syntax->next->next != NULL) { tSyntaxElement* token = tree->content.syntax; if (strcmp(token->content.string,"def") == 0) { char* replacethis = token->next->content.string;