diff options
author | Simon Rettberg | 2024-04-23 12:20:00 +0200 |
---|---|---|
committer | Simon Rettberg | 2024-05-13 18:26:42 +0200 |
commit | 629d240ec364c6006aee823bcf9f2f0c5bc5945e (patch) | |
tree | 32fda7c8ff42e75ac43d3c56cbd2446b002009cf /src/cowtest/main.c | |
parent | [FUSE] Fix use-after-free of curl_slist; unify init code (diff) | |
download | dnbd3-629d240ec364c6006aee823bcf9f2f0c5bc5945e.tar.gz dnbd3-629d240ec364c6006aee823bcf9f2f0c5bc5945e.tar.xz dnbd3-629d240ec364c6006aee823bcf9f2f0c5bc5945e.zip |
[FUSE] Fix division by zero
Diffstat (limited to 'src/cowtest/main.c')
-rw-r--r-- | src/cowtest/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowtest/main.c b/src/cowtest/main.c index c7da4ac..dc2bac5 100644 --- a/src/cowtest/main.c +++ b/src/cowtest/main.c @@ -1061,7 +1061,7 @@ bool randomWriteTest( char *mountedImagePath, char *normalImagePath, float minS off_t offset = rand() % maxOffset; size_t size = ( rand() + offset ) % RND_MAX_WRITE_SIZE; if ( size < RND_MAX_WRITE_SIZE / 2 ) { - size /= rand() % 8192; + size /= 1 + ( rand() % 8192 ); } size = MAX( size, 1 ); if ( r > RND_TRUNCATE_PROBABILITY + RND_UNALIGNED_WRITE_PROBABILITY ) { |