Commit a48ee56
Fix undefined behaviour in bitops unit test (valkey-io#1786)
The unit test was added in valkey-io#1741. It fails when compiled with UBSAN.
Using a local array like `char buf[size]` is undefined behaviour when
`size == 0`. This fix just makes it size 1 in this case.
The failure I got locally:
unit/test_bitops.c:28:13: runtime error: variable length array bound
evaluates to non-positive value 0
Signed-off-by: Viktor Söderqvist <[email protected]>1 parent 522a569 commit a48ee56
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
0 commit comments