summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-08-08 08:00:00 +0800
committerRunxi Yu <me@runxiyu.org>2024-08-08 08:00:00 +0800
commit33d57d284fe7d786fdedcb247f265a5544d2dd41 (patch)
treec11675efa50f79ab29d9299b7c1492999f2201cb
parentMakefile: complain when config.mk is not found (diff)
downloadpouncerx-master.tar.gz
pouncerx-master.zip
Remove potential UB in local.cHEADmaster
-rw-r--r--local.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/local.c b/local.c
index fcd670a..133b7c3 100644
--- a/local.c
+++ b/local.c
@@ -52,8 +52,9 @@ int localConfig(
struct tls_config *config = tls_config_new();
if (!config) errx(EX_SOFTWARE, "tls_config_new");
- int error;
+ int error = -1;
char buf[PATH_MAX];
+
for (int i = 0; configPath(buf, sizeof(buf), cert, i); ++i) {
error = tls_config_set_cert_file(config, buf);
if (!error) break;