lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 26 Jun 2024 02:54:09 -0700
From: Zhu Jun <zhujun2@...s.chinamobile.com>
To: ivan.orlov0322@...il.com
Cc: broonie@...nel.org,
	perex@...ex.cz,
	tiwai@...e.com,
	shuah@...nel.org,
	linux-sound@...r.kernel.org,
	linux-kselftest@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	zhujun2@...s.chinamobile.com
Subject: [PATCH] selftests/alsa:Replace malloc with calloc

Using calloc to handling memory allocation, calloc
can initialize the allocated memory

Signed-off-by: Zhu Jun <zhujun2@...s.chinamobile.com>
---
 tools/testing/selftests/alsa/test-pcmtest-driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/alsa/test-pcmtest-driver.c b/tools/testing/selftests/alsa/test-pcmtest-driver.c
index ca81afa4ee90..0a551b5f41f7 100644
--- a/tools/testing/selftests/alsa/test-pcmtest-driver.c
+++ b/tools/testing/selftests/alsa/test-pcmtest-driver.c
@@ -134,6 +134,7 @@ FIXTURE_SETUP(pcmtest) {
 		SKIP(return, "Can't read patterns. Probably, module isn't loaded");
 
 	card_name = malloc(127);
+	memset(card_name, 0, 127);
 	ASSERT_NE(card_name, NULL);
 	self->params.buffer_size = 16384;
 	self->params.period_size = 4096;
-- 
2.17.1




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ