[LTP] [PATCH v1] mc_opts/mc_verify_opts.c: Initialize local variable

Bogdan Lezhepekov blezhepekov@suse.de
Wed Feb 16 10:25:53 CET 2022


In some cases uninitialized array was used
when comparing strings in main().

Signed-off-by: Bogdan Lezhepekov <blezhepekov@suse.de>
---
 testcases/network/multicast/mc_opts/mc_verify_opts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/network/multicast/mc_opts/mc_verify_opts.c b/testcases/network/multicast/mc_opts/mc_verify_opts.c
index 679b81777..8946324bd 100644
--- a/testcases/network/multicast/mc_opts/mc_verify_opts.c
+++ b/testcases/network/multicast/mc_opts/mc_verify_opts.c
@@ -22,7 +22,7 @@ int main(int argc, char *argv[])
 	unsigned i1, i2, i3, i4;
 	struct hostent *hp, *gethostbyname();
 
-	char sintf[20], gintf[20];
+	char sintf[20], gintf[20] = {0};
 	unsigned char ttl;
 	char loop = 0;
 	unsigned int len = 0;
-- 
2.35.1



More information about the ltp mailing list