44 lines
1.6 KiB
Diff
44 lines
1.6 KiB
Diff
|
From 625274738b5f68418608be99b68d35c43079e2a1 Mon Sep 17 00:00:00 2001
|
||
|
From: Alexey Tikhonov <atikhono@redhat.com>
|
||
|
Date: Thu, 14 Oct 2021 18:48:09 +0200
|
||
|
Subject: [PATCH 01/17] DEBUG: fix missing "va_end"
|
||
|
|
||
|
Fixes following warning:
|
||
|
```
|
||
|
Error: VARARGS (CWE-237):
|
||
|
sssd-2.6.0/src/util/debug.c:294: va_init: Initializing va_list "ap_fallback".
|
||
|
sssd-2.6.0/src/util/debug.c:305: missing_va_end: "va_end" was not called for "ap_fallback".
|
||
|
# 303| debug_chain_id, format);
|
||
|
# 304| if (ret < 0) {
|
||
|
# 305|-> return;
|
||
|
# 306| }
|
||
|
# 307| result_fmt = chain_id_fmt_dyn;
|
||
|
```
|
||
|
|
||
|
Reviewed-by: Sumit Bose <sbose@redhat.com>
|
||
|
---
|
||
|
src/util/debug.c | 2 ++
|
||
|
1 file changed, 2 insertions(+)
|
||
|
|
||
|
diff --git a/src/util/debug.c b/src/util/debug.c
|
||
|
index 51fb42d3cf454ab8a83aa82329725bd250ce271c..7c03fb7dfff1bd6b9510ecd3c2e0948a83e7622e 100644
|
||
|
--- a/src/util/debug.c
|
||
|
+++ b/src/util/debug.c
|
||
|
@@ -297,11 +297,13 @@ void sss_vdebug_fn(const char *file,
|
||
|
ret = snprintf(chain_id_fmt_fixed, sizeof(chain_id_fmt_fixed),
|
||
|
DEBUG_CHAIN_ID_FMT"%s", debug_chain_id, format);
|
||
|
if (ret < 0) {
|
||
|
+ va_end(ap_fallback);
|
||
|
return;
|
||
|
} else if (ret >= sizeof(chain_id_fmt_fixed)) {
|
||
|
ret = asprintf(&chain_id_fmt_dyn, DEBUG_CHAIN_ID_FMT"%s",
|
||
|
debug_chain_id, format);
|
||
|
if (ret < 0) {
|
||
|
+ va_end(ap_fallback);
|
||
|
return;
|
||
|
}
|
||
|
result_fmt = chain_id_fmt_dyn;
|
||
|
--
|
||
|
2.31.1
|
||
|
|