Project

General

Profile

Bug #451 » 0001-bug-451-fix-for-parsing-address.-Increase-buffer-siz.patch

Anoop Saldanha, 05/04/2012 01:31 AM

View differences:

src/detect-engine-address.c
int o_set = 0, n_set = 0, d_set = 0;
int depth = 0;
size_t size = strlen(s);
char address[1024] = "";
char address[8196] = "";
char *rule_var_address = NULL;
char *temp_rule_var_address = NULL;
......
} else if (depth == 0 && s[u] == '$') {
d_set = 1;
} else if (depth == 0 && u == size - 1) {
if (x == 1024) {
if (x == sizeof(address)) {
address[x - 1] = '\0';
} else {
address[x] = '\0';
src/detect-engine-iponly.c
int o_set = 0, n_set = 0, d_set = 0;
int depth = 0;
size_t size = strlen(s);
char address[1024] = "";
char address[8196] = "";
char *rule_var_address = NULL;
char *temp_rule_var_address = NULL;
IPOnlyCIDRItem *head;
......
} else if (depth == 0 && s[u] == '$') {
d_set = 1;
} else if (depth == 0 && u == size - 1) {
if (x == 1024) {
if (x == sizeof(address)) {
address[x - 1] = '\0';
} else {
address[x] = '\0';
(2-2/3)