mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2026-05-08 23:56:48 -04:00
altstr: fixed optimization error with fixed len alternates
altstr: consistent conditional applied to byte alternates
This commit is contained in:
@@ -949,11 +949,11 @@ inline static int ac_findmatch_special(const unsigned char *buffer, uint32_t off
|
||||
switch(special->type) {
|
||||
case AC_SPECIAL_ALT_CHAR: /* single-byte */
|
||||
for (j = 0; j < special->num; j++) {
|
||||
cmp = (special->alt).byte[j] - b;
|
||||
cmp = b - (special->alt).byte[j];
|
||||
if (cmp == 0) {
|
||||
match = !special->negative;
|
||||
break;
|
||||
} else if (cmp > 0)
|
||||
} else if (cmp < 0)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -968,7 +968,7 @@ inline static int ac_findmatch_special(const unsigned char *buffer, uint32_t off
|
||||
if (cmp == 0) {
|
||||
match = (!special->negative) * special->len;
|
||||
break;
|
||||
} else if (cmp > 0)
|
||||
} else if (cmp < 0)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user