From b16dcc3fd38cfd971bf73ecbf57921cc3fb1911d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Fri, 18 Sep 2026 13:49:23 -0700 Subject: [PATCH] fix: handle potential NULL pointer dereference in debug logging --- runtime/fastly/handler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/fastly/handler.cpp b/runtime/fastly/handler.cpp index 7e16cc4511..a58328a751 100644 --- a/runtime/fastly/handler.cpp +++ b/runtime/fastly/handler.cpp @@ -48,8 +48,9 @@ bool handle_incoming(host_api::Request req) { __wasilibc_ensure_environ(); if (ENGINE->debug_logging_enabled()) { + const char *ver = getenv("FASTLY_SERVICE_VERSION"); printf("Running JS handleRequest function for Fastly Compute service version %s\n", - getenv("FASTLY_SERVICE_VERSION")); + ver ? ver : "unknown"); fflush(stdout); }