From 33d57d284fe7d786fdedcb247f265a5544d2dd41 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 8 Aug 2024 08:00:00 +0800 Subject: Remove potential UB in local.c --- local.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3