All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] audit: remove redundant data_len check
@ 2022-05-15  7:31 ` Shreenidhi Shedi
  0 siblings, 0 replies; 12+ messages in thread
From: Shreenidhi Shedi @ 2022-05-15  7:31 UTC (permalink / raw)
  To: paul, eparis; +Cc: linux-kernel, linux-audit, yesshedi, Shreenidhi Shedi

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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-06-08 12:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-15  7:31 [PATCH 1/2] audit: remove redundant data_len check Shreenidhi Shedi
2022-05-15  7:31 ` 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

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.