From 6a4f09c8880150a9e6ec9236a686a8ba2d71c747 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sat, 24 May 2025 09:48:42 +0200 Subject: [PATCH] Berry fix vulnerability in solidify code Found by Claude.ai --- lib/libesp32/berry/src/be_solidifylib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libesp32/berry/src/be_solidifylib.c b/lib/libesp32/berry/src/be_solidifylib.c index ecfb75890..1a107dff4 100644 --- a/lib/libesp32/berry/src/be_solidifylib.c +++ b/lib/libesp32/berry/src/be_solidifylib.c @@ -69,7 +69,7 @@ static unsigned toidentifier_length(const char *s) unsigned len = 1; const char * p = s; while (*p) { - if (p[0] == '_' && p[1] == 'X') { + if (p[0] == '_' && p[1] != '\0' && p[1] == 'X') { len += 3; p += 2; } else if (isalnum(p[0]) || p[0] == '_') {