From 0cf937810df19fd1860f120bbac5c75d0d44a117 Mon Sep 17 00:00:00 2001 From: Andrew Gadsby Date: Mon, 6 Jul 2026 15:51:35 +0100 Subject: [PATCH] Fix condition check for httpfd in display_str Fixes issue where requesting version info from the HTML console causes a segmentation fault. @gottfriedleibniz identified the fix for the cases where the httpd fd can be 0. --- version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.c b/version.c index 1b4d12579..f3c8c0c21 100644 --- a/version.c +++ b/version.c @@ -808,7 +808,7 @@ DLL_EXPORT int get_buildinfo_strings(const char*** pppszBldInfoStr) static void display_str( FILE* f, int httpfd, const char* str ) { if (f != stdout) - if (httpfd) + if (httpfd >= 0) hprintf( httpfd, "%s\n", str ); else fprintf( f, "%s\n", str );