mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Fix invalid memory read in msc_tree
This commit is contained in:
parent
8b9041c2da
commit
21777aec41
@ -107,7 +107,7 @@ TreePrefix *CPTCreatePrefix(unsigned char *ipdata, unsigned int ip_bitmask,
|
||||
unsigned char netmask) {
|
||||
|
||||
TreePrefix *prefix = NULL;
|
||||
int bytes = ip_bitmask/8;
|
||||
int bytes = ip_bitmask;
|
||||
|
||||
if ((ip_bitmask % 8 != 0) || (ipdata == NULL)) {
|
||||
return NULL;
|
||||
@ -759,7 +759,6 @@ TreeNode *CPTFindElement(unsigned char *ipdata, unsigned int ip_bitmask, CPTTree
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
if ((node->prefix->buffer[bytes] & mask) == (temp_data[bytes] & mask)) {
|
||||
if (TreePrefixNetmask(node->prefix, ip_bitmask, TRUE)) {
|
||||
//if (msr && msr->txcfg->debuglog_level >= 9) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user