Commit 6e45c13
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, ...
```
Checkpatch-ignore: GIT_COMMIT_ID
This is caused by a NULL pointer passed to bsearch function when
abstract command cache is still empty. This behavor was introduced in
commit ab97974 ("target/riscv: implement abstract command cache ...")
Signed-off-by: Parshintsev Anatoly <[email protected]>1 parent 608ba43 commit 6e45c13
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