[glib: 3/8] ghmac: Use new g_alloca0() function




commit 8bf62d63097297c303a0f96b74d35d4ae5555a48
Author: Nishal Kulkarni <nishalkulkarni gmail com>
Date:   Thu Nov 25 13:44:23 2021 +0530

    ghmac: Use new g_alloca0() function
    
    Replace `g_alloca()` and `memset()` with `g_alloca0()`

 glib/ghmac.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/glib/ghmac.c b/glib/ghmac.c
index 49fd272f0..54da9f936 100644
--- a/glib/ghmac.c
+++ b/glib/ghmac.c
@@ -127,11 +127,9 @@ g_hmac_new (GChecksumType  digest_type,
   hmac->digesti = checksum;
   hmac->digesto = g_checksum_new (digest_type);
 
-  buffer = g_alloca (block_size);
+  buffer = g_alloca0 (block_size);
   pad = g_alloca (block_size);
 
-  memset (buffer, 0, block_size);
-
   /* If the key is too long, hash it */
   if (key_len > block_size)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]