From ab74ee72bcc4d20a4f5683e0e70750fac3c3cdd1 Mon Sep 17 00:00:00 2001 From: he-pian <2810516108@qq.com> Date: Fri, 27 Dec 2024 11:30:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=A8=B3=E5=AE=9A=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: he-pian <2810516108@qq.com> --- frameworks/libhilog/vsnprintf/output_p.inl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frameworks/libhilog/vsnprintf/output_p.inl b/frameworks/libhilog/vsnprintf/output_p.inl index e542424..2825fd4 100644 --- a/frameworks/libhilog/vsnprintf/output_p.inl +++ b/frameworks/libhilog/vsnprintf/output_p.inl @@ -493,6 +493,9 @@ int SecOutputPS(SecPrintfStream *stream, int priv, const char *cformat, va_list /* loop each format character */ /* remove format != NULL */ while ((ch = *format++) != SECUREC_CHAR('\0') && charsOut >= 0) { + if (!format) { + return -1; + } laststate = state; state = SECUREC_DECODE_STATE(ch, fmtCharTable, laststate); -- Gitee