From 99caa82b9406ef344707401c0b8c548296924466 Mon Sep 17 00:00:00 2001 From: haozi007 Date: Sat, 15 Oct 2022 17:18:28 +0800 Subject: [PATCH 10/43] ensure argument is not null Signed-off-by: haozi007 --- src/utils/cutils/error.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/cutils/error.h b/src/utils/cutils/error.h index 5a8dca99..e3946cf2 100644 --- a/src/utils/cutils/error.h +++ b/src/utils/cutils/error.h @@ -62,6 +62,10 @@ static inline void format_errorf(char **err, const char *format, ...) va_list argp; va_start(argp, format); + if (err == NULL) { + return; + } + ret = vsnprintf(errbuf, BUFSIZ, format, argp); va_end(argp); if (ret < 0) { -- 2.25.1