Commit 61b0494
committed
target/riscv: fix potential UB reported by ubsan in ac cache lookup
when running OpenOCD built with ubsan enabled I've encountered the
following error message:
```
riscv-013.c:204:9: runtime error: null pointer passed as argument 2, which is declared to never be null
```
This is caused by a NULL pointer passed to bsearch function when
abstract command cache is still empty. This behavor was introduced in
ab979741 parent 608ba43 commit 61b0494
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| |||
0 commit comments