mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +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) {
|
unsigned char netmask) {
|
||||||
|
|
||||||
TreePrefix *prefix = NULL;
|
TreePrefix *prefix = NULL;
|
||||||
int bytes = ip_bitmask/8;
|
int bytes = ip_bitmask;
|
||||||
|
|
||||||
if ((ip_bitmask % 8 != 0) || (ipdata == NULL)) {
|
if ((ip_bitmask % 8 != 0) || (ipdata == NULL)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -759,7 +759,6 @@ TreeNode *CPTFindElement(unsigned char *ipdata, unsigned int ip_bitmask, CPTTree
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((node->prefix->buffer[bytes] & mask) == (temp_data[bytes] & mask)) {
|
if ((node->prefix->buffer[bytes] & mask) == (temp_data[bytes] & mask)) {
|
||||||
if (TreePrefixNetmask(node->prefix, ip_bitmask, TRUE)) {
|
if (TreePrefixNetmask(node->prefix, ip_bitmask, TRUE)) {
|
||||||
//if (msr && msr->txcfg->debuglog_level >= 9) {
|
//if (msr && msr->txcfg->debuglog_level >= 9) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user