From a3c6cd9a0f8acb08916d8a8a80771628d246debf Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 9 Sep 2025 20:44:41 -0400 Subject: Fix for potential null dereference --- src/formatter/formatter.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/formatter/formatter.c') diff --git a/src/formatter/formatter.c b/src/formatter/formatter.c index 2c52aa63..07a70afa 100644 --- a/src/formatter/formatter.c +++ b/src/formatter/formatter.c @@ -54,7 +54,9 @@ PUREFUNC text_opts_t choose_text_options(ast_list_t *chunks) { } static bool starts_with_id(Text_t text) { + if (text.length <= 0) return false; List_t codepoints = Text$utf32(Text$slice(text, I_small(1), I_small(1))); + if (codepoints.length <= 0 || codepoints.data == NULL) return false; return uc_is_property_xid_continue(*(ucs4_t *)codepoints.data); } -- cgit v1.2.3