File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 55
66#include <stddef.h>
77#include <stdio.h>
8+ #include <stdlib.h>
89#include <string.h>
910#include "notrandombytes/notrandombytes.h"
1011
@@ -103,19 +104,24 @@ static int test_mld_polyz_unpack_core(const uint8_t *input,
103104
104105static int test_native_polyz_unpack (void )
105106{
106- uint8_t test_bytes [ MLDSA_POLYZ_PACKEDBYTES ] ;
107+ uint8_t * test_bytes = malloc ( MLDSA_POLYZ_PACKEDBYTES ) ;
107108 int i ;
108109
110+ if (test_bytes == NULL )
111+ {
112+ return 1 ;
113+ }
114+
109115 memset (test_bytes , 0 , MLDSA_POLYZ_PACKEDBYTES );
110116 CHECK (test_mld_polyz_unpack_core (test_bytes , "polyz_unpack_zeros" ) == 0 );
111117
112-
113118 for (i = 0 ; i < NUM_RANDOM_TESTS ; i ++ )
114119 {
115120 randombytes (test_bytes , MLDSA_POLYZ_PACKEDBYTES );
116121 CHECK (test_mld_polyz_unpack_core (test_bytes , "polyz_unpack_random" ) == 0 );
117122 }
118123
124+ free (test_bytes );
119125 return 0 ;
120126}
121127#endif /* MLD_USE_NATIVE_POLYZ_UNPACK_17 || MLD_USE_NATIVE_POLYZ_UNPACK_19 */
You can’t perform that action at this time.
0 commit comments