From 00a7f6f86d22b9130b32a026f0d355e670b0a0ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 1 Jun 2018 13:01:42 -0400 Subject: [PATCH] Silence strncpy warning emitted by GCC 8 in XSD path construction MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The size of the XSD's path is fully determined in this function which makes strcpy() safe to use. Signed-off-by: Jérémie Galarneau --- src/common/config/session-config.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c index 4d12870e8..01ae901ad 100644 --- a/src/common/config/session-config.c +++ b/src/common/config/session-config.c @@ -677,13 +677,12 @@ char *get_session_config_xsd_path() goto end; } - strncpy(xsd_path, base_path, max_path_len); + strcpy(xsd_path, base_path); if (xsd_path[base_path_len - 1] != '/') { xsd_path[base_path_len++] = '/'; } - strncpy(xsd_path + base_path_len, DEFAULT_SESSION_CONFIG_XSD_FILENAME, - max_path_len - base_path_len); + strcpy(xsd_path + base_path_len, DEFAULT_SESSION_CONFIG_XSD_FILENAME); end: return xsd_path; } -- 2.34.1