"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/detection-plugins/sp_isdataat.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_isdataat.c  (snort-2.9.16.1):sp_isdataat.c  (snort-2.9.17)
skipping to change at line 258 skipping to change at line 258
} }
if(idx->offset > 65535) if(idx->offset > 65535)
{ {
FatalError("%s(%d): IsDataAt offset greater than max IPV4 packet siz e", FatalError("%s(%d): IsDataAt offset greater than max IPV4 packet siz e",
file_name, file_line); file_name, file_line);
} }
} }
else else
{ {
if (bytemath_variable_name && (strcmp(bytemath_variable_name,offset) == idx->offset_var = find_value(offset);
0)) if (idx->offset_var == BYTE_EXTRACT_NO_VAR)
idx->offset_var= BYTE_MATH_VAR_INDEX;
else
{ {
idx->offset_var = GetVarByName(offset); ParseError(BYTE_EXTRACT_INVALID_ERR_FMT, "isdataat", toks[0]);
if (idx->offset_var == BYTE_EXTRACT_NO_VAR)
ParseError(BYTE_EXTRACT_INVALID_ERR_FMT, "isdataat", toks[0]);
} }
} }
for (i=1; i< num_toks; i++) for (i=1; i< num_toks; i++)
{ {
cptr = toks[i]; cptr = toks[i];
while(isspace((int)*cptr)) {cptr++;} while(isspace((int)*cptr)) {cptr++;}
if(!strcasecmp(cptr, "relative")) if(!strcasecmp(cptr, "relative"))
skipping to change at line 330 skipping to change at line 327
if (!isdata) if (!isdata)
{ {
PREPROC_PROFILE_END(isDataAtPerfStats); PREPROC_PROFILE_END(isDataAtPerfStats);
return rval; return rval;
} }
/* Get values from byte_math/byte_extract variables, if present. */ /* Get values from byte_math/byte_extract variables, if present. */
if (isdata->offset_var >= 0 ) if (isdata->offset_var >= 0 )
{ {
if(isdata->offset_var == BYTE_MATH_VAR_INDEX ) if(isdata->offset_var == BYTE_MATH_VAR_INDEX )
isdata->offset = (int32_t) bytemath_variable;
else
{ {
if (isdata->offset_var < NUM_BYTE_EXTRACT_VARS) isdata->offset = (int32_t) bytemath_variable;
GetByteExtractValue(&(isdata->offset), isdata->offset_var); }
else if(isdata->offset_var == COMMON_VAR_INDEX )
{
isdata->offset = (int32_t) common_var;
}
else if (isdata->offset_var < NUM_BYTE_EXTRACT_VARS)
{
GetByteExtractValue(&(isdata->offset), isdata->offset_var);
} }
} }
if (isdata->flags & ISDATAAT_RAWBYTES_FLAG) if (isdata->flags & ISDATAAT_RAWBYTES_FLAG)
{ {
/* Rawbytes specified, force use of that buffer */ /* Rawbytes specified, force use of that buffer */
dsize = p->dsize; dsize = p->dsize;
start_ptr = p->data; start_ptr = p->data;
DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH,
"Using RAWBYTES buffer!\n");); "Using RAWBYTES buffer!\n"););
 End of changes. 4 change blocks. 
11 lines changed or deleted 12 lines changed or added

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