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 $ */
2
2
3
3
/*
4
4
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
@@ -45,6 +45,7 @@ test_bn_print_null_derefs(void)
45
45
size_t size = INT_MAX / 4 + 4 ;
46
46
size_t datalimit = (size + 500 * 1024 ) / 1024 ;
47
47
char * a ;
48
+ char digit ;
48
49
int failed = 0 ;
49
50
50
51
if ((a = malloc (size )) == NULL ) {
@@ -53,7 +54,10 @@ test_bn_print_null_derefs(void)
53
54
return 0 ;
54
55
}
55
56
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 );
57
61
a [size - 1 ] = '\0' ;
58
62
59
63
failed |= test_bn_print_wrapper (a , size , "BN_dec2bn" , BN_dec2bn );
You can’t perform that action at this time.
0 commit comments