mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Code cleanup: Initialize variables and others good practice
- initialize invalid_countin UrlDecode :: evaluate - Free resources before the process die (good practice)
This commit is contained in:
parent
a278bb673a
commit
e4c822e663
6
CHANGES
6
CHANGES
@ -5,14 +5,12 @@ v3.0.3 - YYYY-MMM-DD (to be released)
|
|||||||
[Issue #1771 - @Artistan]
|
[Issue #1771 - @Artistan]
|
||||||
- Checks if response body inspection is enabled before process it
|
- Checks if response body inspection is enabled before process it
|
||||||
[Issue #1643 - @zoltan-fedor, @dennus, @defanator, @zimmerle]
|
[Issue #1643 - @zoltan-fedor, @dennus, @defanator, @zimmerle]
|
||||||
- processContentOffset Cleanup
|
- Code Cleanup.
|
||||||
[Issue #1757 - @p0pr0ck5]
|
[Issue #1757, #1755, #1756, #1761 - @p0pr0ck5]
|
||||||
- Fix setvar parsing of quoted data
|
- Fix setvar parsing of quoted data
|
||||||
[Issue #1733, #1759 - @JaiHarpalani, @victorhora, @defanator]
|
[Issue #1733, #1759 - @JaiHarpalani, @victorhora, @defanator]
|
||||||
- Fix LDFLAGS for unit tests.
|
- Fix LDFLAGS for unit tests.
|
||||||
[Issue #1758 - @smlx]
|
[Issue #1758 - @smlx]
|
||||||
- Code cosmetics: Clean up MD5 hexdigest
|
|
||||||
[Issue #1761 - @p0pr0ck5]
|
|
||||||
- Adds time stamp back to the audit logs
|
- Adds time stamp back to the audit logs
|
||||||
[Issue #1762 - @Pjack, @zimmerle]
|
[Issue #1762 - @Pjack, @zimmerle]
|
||||||
- Disables skip counter if debug log is disabled
|
- Disables skip counter if debug log is disabled
|
||||||
|
@ -40,7 +40,7 @@ UrlDecode::UrlDecode(std::string action)
|
|||||||
std::string UrlDecode::evaluate(std::string value,
|
std::string UrlDecode::evaluate(std::string value,
|
||||||
Transaction *transaction) {
|
Transaction *transaction) {
|
||||||
unsigned char *val = NULL;
|
unsigned char *val = NULL;
|
||||||
int invalid_count;
|
int invalid_count = 0;
|
||||||
int changed;
|
int changed;
|
||||||
|
|
||||||
val = (unsigned char *) malloc(sizeof(char) * value.size() + 1);
|
val = (unsigned char *) malloc(sizeof(char) * value.size() + 1);
|
||||||
|
@ -461,8 +461,11 @@ TreeNode *CPTAddElement(unsigned char *ipdata, unsigned int ip_bitmask, CPTTree
|
|||||||
} else {
|
} else {
|
||||||
i_node = CPTCreateNode();
|
i_node = CPTCreateNode();
|
||||||
|
|
||||||
if(i_node == NULL)
|
if (i_node == NULL) {
|
||||||
|
free(new_node->prefix);
|
||||||
|
free(new_node);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
//i_node->prefix = NULL;
|
//i_node->prefix = NULL;
|
||||||
i_node->bit = test_bit;
|
i_node->bit = test_bit;
|
||||||
@ -480,6 +483,9 @@ TreeNode *CPTAddElement(unsigned char *ipdata, unsigned int ip_bitmask, CPTTree
|
|||||||
i_node->netmasks = reinterpret_cast<unsigned char *>(malloc((node->count - i) * sizeof(unsigned char)));
|
i_node->netmasks = reinterpret_cast<unsigned char *>(malloc((node->count - i) * sizeof(unsigned char)));
|
||||||
|
|
||||||
if(i_node->netmasks == NULL) {
|
if(i_node->netmasks == NULL) {
|
||||||
|
free(new_node->prefix);
|
||||||
|
free(new_node);
|
||||||
|
free(i_node);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user