Fix Coverity CID 316216 (OOB)

This commit is contained in:
Anton Kochkov 2021-04-14 13:05:04 +08:00 committed by Anton Kochkov
parent e2346d9b81
commit f32d8c1d73

View file

@ -91,7 +91,7 @@ static int hit(RzSearchKeyword *kw, void *user, ut64 addr) {
str[j] = 0;
} else {
size_t i;
for (i = 0; i < sizeof(_str); i++) {
for (i = 0; i < sizeof(_str) - 1; i++) {
char ch = ro->buf[delta + i];
if (ch == '"' || ch == '\\') {
ch = '\'';
@ -105,7 +105,7 @@ static int hit(RzSearchKeyword *kw, void *user, ut64 addr) {
}
} else {
size_t i;
for (i = 0; i < sizeof(_str); i++) {
for (i = 0; i < sizeof(_str) - 1; i++) {
char ch = ro->buf[delta + i];
if (ch == '"' || ch == '\\') {
ch = '\'';