From 8ba535160cb7f587a617314e9b07541be08f6638 Mon Sep 17 00:00:00 2001 From: Dave Gosselin Date: Fri, 6 Dec 2024 11:36:38 -0500 Subject: [PATCH] CONC-750 unit.pfs_instr-oom fails on mac with dynamic-stack-overflow Write a NULL byte at end of the array used for reading the executable name, not at one past the end of the array. --- mariadb_config/mariadb_config.c.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mariadb_config/mariadb_config.c.in b/mariadb_config/mariadb_config.c.in index 5c057c4c3..b79f0aca9 100644 --- a/mariadb_config/mariadb_config.c.in +++ b/mariadb_config/mariadb_config.c.in @@ -175,7 +175,9 @@ static void mariadb_get_install_location() goto end; else { #if defined(__APPLE__) - unsigned int len= PATH_MAX; + // If reading the path was successful, then *bufsize is + // unchanged. + unsigned int len= PATH_MAX - 1; if (_NSGetExecutablePath(p, &len) != 0) *p= 0; else