File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/regress/lib/libcrypto/bn/general Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1- /* $OpenBSD: bn_unit.c,v 1.3 2022/11/23 08:01:05 tb Exp $ */
1+ /* $OpenBSD: bn_unit.c,v 1.4 2022/11/23 08:58:34 tb Exp $ */
22
33/*
44 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
@@ -45,6 +45,7 @@ test_bn_print_null_derefs(void)
4545 size_t size = INT_MAX / 4 + 4 ;
4646 size_t datalimit = (size + 500 * 1024 ) / 1024 ;
4747 char * a ;
48+ char digit ;
4849 int failed = 0 ;
4950
5051 if ((a = malloc (size )) == NULL ) {
@@ -53,7 +54,10 @@ test_bn_print_null_derefs(void)
5354 return 0 ;
5455 }
5556
56- memset (a , '0' , size - 1 );
57+ /* Fill with a random digit since coverity doesn't like us using '0'. */
58+ digit = '0' + arc4random_uniform (10 );
59+
60+ memset (a , digit , size - 1 );
5761 a [size - 1 ] = '\0' ;
5862
5963 failed |= test_bn_print_wrapper (a , size , "BN_dec2bn" , BN_dec2bn );
You can’t perform that action at this time.
0 commit comments