Lines 4929-4941
AP_DECLARE(void) ap_random_insecure_bytes(void *buf, apr_size_t size)
Link Here
|
4929 |
AP_DECLARE(apr_uint32_t) ap_random_pick(apr_uint32_t min, apr_uint32_t max) |
4929 |
AP_DECLARE(apr_uint32_t) ap_random_pick(apr_uint32_t min, apr_uint32_t max) |
4930 |
{ |
4930 |
{ |
4931 |
apr_uint32_t number; |
4931 |
apr_uint32_t number; |
|
|
4932 |
#if !(__GNUC__ && __sparc__ && APR_SIZEOF_VOIDP == 8) |
4933 |
/* This triggers a gcc bug on sparc/64bit, PR 52900 */ |
4932 |
if (max < 16384) { |
4934 |
if (max < 16384) { |
4933 |
apr_uint16_t num16; |
4935 |
apr_uint16_t num16; |
4934 |
ap_random_insecure_bytes(&num16, sizeof(num16)); |
4936 |
ap_random_insecure_bytes(&num16, sizeof(num16)); |
4935 |
RAND_RANGE(num16, min, max, APR_UINT16_MAX); |
4937 |
RAND_RANGE(num16, min, max, APR_UINT16_MAX); |
4936 |
number = num16; |
4938 |
number = num16; |
4937 |
} |
4939 |
} |
4938 |
else { |
4940 |
else |
|
|
4941 |
#endif |
4942 |
{ |
4939 |
ap_random_insecure_bytes(&number, sizeof(number)); |
4943 |
ap_random_insecure_bytes(&number, sizeof(number)); |
4940 |
RAND_RANGE(number, min, max, APR_UINT32_MAX); |
4944 |
RAND_RANGE(number, min, max, APR_UINT32_MAX); |
4941 |
} |
4945 |
} |