patch-src_detection-plugins_sp_pattern_match_c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- snort-2.8.5.2.orig/src/detection-plugins/sp_pattern_match.c 2009-08-10 22:41:44.000000000 +0200
  2. +++ snort-2.8.5.2/src/detection-plugins/sp_pattern_match.c 2010-01-19 19:58:58.000000000 +0100
  3. @@ -831,7 +831,7 @@ void PayloadSearchListInit(char *data, O
  4. data++;
  5. /* grab everything between the starting " and the end one */
  6. - sptr = index(data, '"');
  7. + sptr = strchr(data, '"');
  8. eptr = strrchr(data, '"');
  9. if(sptr != NULL && eptr != NULL)
  10. @@ -862,21 +862,21 @@ static char *PayloadExtractParameter(cha
  11. char *quote_one = NULL, *quote_two = NULL;
  12. char *comma = NULL;
  13. - quote_one = index(data, '"');
  14. + quote_one = strchr(data, '"');
  15. if (quote_one)
  16. {
  17. - quote_two = index(quote_one+1, '"');
  18. + quote_two = strchr(quote_one+1, '"');
  19. while ( quote_two && quote_two[-1] == '\\' )
  20. - quote_two = index(quote_two+1, '"');
  21. + quote_two = strchr(quote_two+1, '"');
  22. }
  23. if (quote_one && quote_two)
  24. {
  25. - comma = index(quote_two, ',');
  26. + comma = strchr(quote_two, ',');
  27. }
  28. else if (!quote_one)
  29. {
  30. - comma = index(data, ',');
  31. + comma = strchr(data, ',');
  32. }
  33. if (comma)
  34. @@ -2035,7 +2035,7 @@ void ParsePattern(char *rule, OptTreeNod
  35. }
  36. /* find the start of the data */
  37. - start_ptr = index(rule, '"');
  38. + start_ptr = strchr(rule, '"');
  39. if(start_ptr != rule)
  40. {