]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
log: protect errno from log_syntax_invalid_utf8_internal()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 1 Sep 2024 07:17:08 +0000 (16:17 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 1 Sep 2024 20:45:09 +0000 (05:45 +0900)
Potentially, utf8_escape_invalid() called by
log_syntax_invalid_utf8_internal() may update errno.

src/basic/log.c

index 80789ed2f07a52b3c8769dabb51b64724fa5f463..c3e61ab5d4f33955263053373acf8f00b3650d95 100644 (file)
@@ -1679,6 +1679,7 @@ int log_syntax_invalid_utf8_internal(
                 const char *func,
                 const char *rvalue) {
 
+        PROTECT_ERRNO;
         _cleanup_free_ char *p = NULL;
 
         if (rvalue)