From: Aleš Mrázek Date: Fri, 22 Aug 2025 11:36:34 +0000 (+0200) Subject: lint: daemon/io.c: avoided Null pointer for output stream X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad364cbe74e0dff7f58d5d03880f1dec144fffe4;p=thirdparty%2Fknot-resolver.git lint: daemon/io.c: avoided Null pointer for output stream If it is not checked, the clang-tidy clang-analyzer-core::NonNullParamChecker error will be raised. --- diff --git a/daemon/io.c b/daemon/io.c index fa99ac036..79a586b24 100644 --- a/daemon/io.c +++ b/daemon/io.c @@ -567,6 +567,11 @@ void io_tty_process_input(uv_stream_t *stream, ssize_t nread, const uv_buf_t *bu } } + /* Avoid Null pointer */ + if (!out) { + return; + } + /** The current single command and the remaining command(s). */ char *cmd, *cmd_next = NULL; bool incomplete_cmd = false;