From: Shreenidhi Shedi <yesshedi@gmail.com> To: paul@paul-moore.com, eparis@redhat.com Cc: linux-kernel@vger.kernel.org, linux-audit@redhat.com, yesshedi@gmail.com, Shreenidhi Shedi <sshedi@vmware.com> Subject: [PATCH 1/2] audit: remove redundant data_len check Date: Sun, 15 May 2022 13:01:09 +0530 [thread overview] Message-ID: <20220515073110.304193-1-sshedi@vmware.com> (raw) data_len is already getting checked if it's less than 2 earlier in this function. Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com> --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index 7690c29d4..0749211d5 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1390,7 +1390,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) str); } else { audit_log_format(ab, " data="); - if (data_len > 0 && str[data_len - 1] == '\0') + if (str[data_len - 1] == '\0') data_len--; audit_log_n_untrustedstring(ab, str, data_len); } -- 2.36.1
WARNING: multiple messages have this Message-ID (diff)
From: Shreenidhi Shedi <yesshedi@gmail.com> To: paul@paul-moore.com, eparis@redhat.com Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org, Shreenidhi Shedi <sshedi@vmware.com>, yesshedi@gmail.com Subject: [PATCH 1/2] audit: remove redundant data_len check Date: Sun, 15 May 2022 13:01:09 +0530 [thread overview] Message-ID: <20220515073110.304193-1-sshedi@vmware.com> (raw) data_len is already getting checked if it's less than 2 earlier in this function. Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com> --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index 7690c29d4..0749211d5 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1390,7 +1390,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) str); } else { audit_log_format(ab, " data="); - if (data_len > 0 && str[data_len - 1] == '\0') + if (str[data_len - 1] == '\0') data_len--; audit_log_n_untrustedstring(ab, str, data_len); } -- 2.36.1 -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit
next reply other threads:[~2022-05-15 7:31 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-15 7:31 Shreenidhi Shedi [this message] 2022-05-15 7:31 ` [PATCH 1/2] audit: remove redundant data_len check Shreenidhi Shedi 2022-05-15 7:31 ` [PATCH 2/2] audit: fix most of the checkpatch.pl warnnings & errors Shreenidhi Shedi 2022-05-15 7:31 ` Shreenidhi Shedi 2022-05-15 23:44 ` Paul Moore 2022-05-15 23:44 ` Paul Moore 2022-05-15 23:35 ` [PATCH 1/2] audit: remove redundant data_len check Paul Moore 2022-05-15 23:35 ` Paul Moore 2022-06-07 20:01 ` Paul Moore 2022-06-07 20:01 ` Paul Moore 2022-06-08 8:43 ` Shreenidhi Shedi 2022-06-08 8:43 ` Shreenidhi Shedi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220515073110.304193-1-sshedi@vmware.com \ --to=yesshedi@gmail.com \ --cc=eparis@redhat.com \ --cc=linux-audit@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=paul@paul-moore.com \ --cc=sshedi@vmware.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.