diff options
author | waja <waja@users.noreply.github.com> | 2021-04-07 14:45:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 14:45:59 (GMT) |
commit | 7ac706e894e292f6389df156f954c1eaafa6241b (patch) | |
tree | 42c48d099534aadeadb4781d1c89794ac179dd4a | |
parent | 10337247973e9fad8a5fed6fc5e78b0637326237 (diff) | |
parent | dae075e65a38c65352d04f8c8fdfa21e2056d01c (diff) | |
download | monitoring-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 11ce691..b8fc5f1 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)) |