From 8a9285aacbf2944e113914e6432c6f8d3efe2692 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 30 Jan 2023 00:56:57 +0100 Subject: [PATCH] Remove unnecessary NUL terminators All the string-copying functions called above do terminate the strings they create with a NUL byte. Writing it again at the end of the buffer is unnecessary paranoid code. Let's remove it. Signed-off-by: Alejandro Colomar --- src/groupmod.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/groupmod.c b/src/groupmod.c index 3799235c..ee6c3e6c 100644 --- a/src/groupmod.c +++ b/src/groupmod.c @@ -627,11 +627,6 @@ static void prepare_failure_reports (void) stpeprintf(info_passwd.action+strlen (info_passwd.action), pw_end, "%ju", (uintmax_t) group_newid); } - info_group.audit_msg[511] = '\0'; -#ifdef SHADOWGRP - info_gshadow.audit_msg[511] = '\0'; -#endif - info_passwd.audit_msg[511] = '\0'; // FIXME: add a system cleanup add_cleanup (cleanup_report_mod_group, &info_group);