summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwaja <waja@users.noreply.github.com>2021-04-07 16:45:59 +0200
committerGitHub <noreply@github.com>2021-04-07 16:45:59 +0200
commit7ac706e894e292f6389df156f954c1eaafa6241b (patch)
tree42c48d099534aadeadb4781d1c89794ac179dd4a
parent10337247973e9fad8a5fed6fc5e78b0637326237 (diff)
parentdae075e65a38c65352d04f8c8fdfa21e2056d01c (diff)
downloadmonitoring-plugins-7ac706e894e292f6389df156f954c1eaafa6241b.tar.gz
Merge pull request #1663 from waja/debian_982847_2
Using snprintf which honors the buffers size and guarantees null temination. (Closes: #1601)
-rw-r--r--plugins/check_pgsql.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 11ce6916..b8fc5f1d 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -347,7 +347,7 @@ process_arguments (int argc, char **argv)
347 if (!is_pg_dbname (optarg)) /* checks length and valid chars */ 347 if (!is_pg_dbname (optarg)) /* checks length and valid chars */
348 usage2 (_("Database name is not valid"), optarg); 348 usage2 (_("Database name is not valid"), optarg);
349 else /* we know length, and know optarg is terminated, so us strcpy */ 349 else /* we know length, and know optarg is terminated, so us strcpy */
350 strcpy (dbName, optarg); 350 snprintf(dbName, NAMEDATALEN, "%s", optarg);
351 break; 351 break;
352 case 'l': /* login name */ 352 case 'l': /* login name */
353 if (!is_pg_logname (optarg)) 353 if (!is_pg_logname (optarg))