Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: x509 - Replace kmalloc() + NUL-termination with kzalloc()

Use kzalloc() to zero out the one-element array instead of using
kmalloc() followed by a manual NUL-termination.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thorsten Blum and committed by
Herbert Xu
b93336cd 5bb61dc7

+1 -2
+1 -2
crypto/asymmetric_keys/x509_cert_parser.c
··· 372 372 373 373 /* Empty name string if no material */ 374 374 if (!ctx->cn_size && !ctx->o_size && !ctx->email_size) { 375 - buffer = kmalloc(1, GFP_KERNEL); 375 + buffer = kzalloc(1, GFP_KERNEL); 376 376 if (!buffer) 377 377 return -ENOMEM; 378 - buffer[0] = 0; 379 378 goto done; 380 379 } 381 380