"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/detection-plugins/sp_byte_extract.c" between
snort-2.9.16.1.tar.gz and snort-2.9.17.tar.gz

About: Snort is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

sp_byte_extract.c  (snort-2.9.16.1):sp_byte_extract.c  (snort-2.9.17)
skipping to change at line 365 skipping to change at line 365
ParseError("byte_extract rule option has invalid Variable name in the " ParseError("byte_extract rule option has invalid Variable name in the "
"\"offset\" field."); "\"offset\" field.");
} }
} }
token = strtok_r(NULL, ",", &saveptr); token = strtok_r(NULL, ",", &saveptr);
} }
/* third: variable name */ /* third: variable name */
if (token) if (token)
{ {
if( bytemath_variable_name && (strcmp(bytemath_variable_name, token) == data->name = SnortStrdup(token);
0) ) isvalidstr(token,"byte_extract");
{ token = strtok_r(NULL, ",", &saveptr);
ParseError("byte_extract : variable name is already used in byte_m
ath rule \n");
}
else
data->name = SnortStrdup(token);
isvalidstr(token,"byte_extract");
token = strtok_r(NULL, ",", &saveptr);
} }
/* optional arguments */ /* optional arguments */
while (token) while (token)
{ {
while(isspace((int)*token)) {token++;} while(isspace((int)*token)) {token++;}
if (strcmp(token, "relative") == 0) if (strcmp(token, "relative") == 0)
{ {
data->relative_flag = 1; data->relative_flag = 1;
} }
skipping to change at line 786 skipping to change at line 780
else if ((data->align == 2) && (*value % 2)) else if ((data->align == 2) && (*value % 2))
{ {
*value = *value + 2 - (*value % 2); *value = *value + 2 - (*value % 2);
} }
/* push doe_ptr */ /* push doe_ptr */
UpdateDoePtr((ptr + bytes_read), rst_doe_flags); UpdateDoePtr((ptr + bytes_read), rst_doe_flags);
/* this rule option always "matches" if the read is performed correctly */ /* this rule option always "matches" if the read is performed correctly */
PREPROC_PROFILE_END(byteExtractPerfStats); PREPROC_PROFILE_END(byteExtractPerfStats);
common_var = *value;
return DETECTION_OPTION_MATCH; return DETECTION_OPTION_MATCH;
} }
/* Setters & Getters for extracted values */ /* Setters & Getters for extracted values */
int GetByteExtractValue(uint32_t *dst, int8_t var_number) int GetByteExtractValue(uint32_t *dst, int8_t var_number)
{ {
if (dst == NULL || var_number >= NUM_BYTE_EXTRACT_VARS) if (dst == NULL || var_number >= NUM_BYTE_EXTRACT_VARS)
return BYTE_EXTRACT_NO_VAR; return BYTE_EXTRACT_NO_VAR;
*dst = extracted_values[var_number]; *dst = extracted_values[var_number];
 End of changes. 2 change blocks. 
11 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)