summaryrefslogtreecommitdiff
path: root/src/certtool-cfg.c
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2021-05-11 14:13:45 +0200
committerDaiki Ueno <ueno@gnu.org>2021-05-11 14:13:57 +0200
commit94eb1e3f3a67d5fc0e29fbf8b4f171c3660a2cca (patch)
tree4141e3564a5885c745ffaf5fa000f5c2dfb96961 /src/certtool-cfg.c
parent2b759674689656b300a322e6f8cea7a3acefafc6 (diff)
downloadgnutls-94eb1e3f3a67d5fc0e29fbf8b4f171c3660a2cca.tar.gz
certtool: tighten allocation check
Spotted by gcc analyzer: certtool-cfg.c:856:24: warning: use of possibly-NULL 'copy' where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument] 856 | while (strcmp(pass, copy) != 0 | ^~~~~~~~~~~~~~~~~~ Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'src/certtool-cfg.c')
-rw-r--r--src/certtool-cfg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/certtool-cfg.c b/src/certtool-cfg.c
index a8103cb837..8c658c8667 100644
--- a/src/certtool-cfg.c
+++ b/src/certtool-cfg.c
@@ -851,6 +851,7 @@ const char *get_confirmed_pass(bool empty_ok)
pass = getpass("Enter password: ");
copy = strdup(pass);
+ CHECK_MALLOC(copy);
pass = getpass("Confirm password: ");
}
while (strcmp(pass, copy) != 0