From 5aae28552801c3aa7323cd1ad0fc88afa1a4ad97 Mon Sep 17 00:00:00 2001 From: Tom Tucker Date: Fri, 10 May 2024 21:52:38 -0600 Subject: [PATCH] Fix static string size bug in store_timescale There is a compile error when built with -Wall -Werror. The host in the format is a static string that is 100 bytes. That with the other elements of the format couuld exceed 128 resulting in truncated output. --- ldms/src/contrib/store/timescale/store_timescale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldms/src/contrib/store/timescale/store_timescale.c b/ldms/src/contrib/store/timescale/store_timescale.c index 07e679ed0..cc1ad72d7 100644 --- a/ldms/src/contrib/store/timescale/store_timescale.c +++ b/ldms/src/contrib/store/timescale/store_timescale.c @@ -332,7 +332,7 @@ open_store(struct ldmsd_store *s, const char *container, const char *schema, is->job_mid = -1; is->comp_mid = -1; - char str[128]; + char str[256]; snprintf(str, sizeof(str), "user=%s password=%s hostaddr=%s port=%s dbname=%s", strdup(user), password, strdup(hostaddr), strdup(port), strdup(dbname)); is->conn = PQconnectdb(str);