patch-src_detection-plugins_sp_pattern_match_c 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. --- snort-2.8.5.1.orig/src/detection-plugins/sp_pattern_match.c 2009-08-10 22:41:44.000000000 +0200
  2. +++ snort-2.8.5.1/src/detection-plugins/sp_pattern_match.c 2009-12-27 17:24:45.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. @@ -2016,7 +2016,7 @@ void ParsePattern(char *rule, OptTreeNod
  35. PatternMatchData *ds_idx;
  36. /* clear out the temp buffer */
  37. - bzero(tmp_buf, MAX_PATTERN_SIZE);
  38. + memset(tmp_buf, 0, MAX_PATTERN_SIZE);
  39. if(rule == NULL)
  40. {
  41. @@ -2035,7 +2035,7 @@ void ParsePattern(char *rule, OptTreeNod
  42. }
  43. /* find the start of the data */
  44. - start_ptr = index(rule, '"');
  45. + start_ptr = strchr(rule, '"');
  46. if(start_ptr != rule)
  47. {
  48. @@ -2089,7 +2089,7 @@ void ParsePattern(char *rule, OptTreeNod
  49. dummy_end = (dummy_idx + size);
  50. /* why is this buffer so small? */
  51. - bzero(hex_buf, 3);
  52. + memset(hex_buf, 0, 3);
  53. memset(hex_buf, '0', 2);
  54. /* BEGIN BAD JUJU..... */
  55. @@ -2204,7 +2204,7 @@ void ParsePattern(char *rule, OptTreeNod
  56. strtol(hex_buf, (char **) NULL, 16)&0xFF;
  57. dummy_size++;
  58. - bzero(hex_buf, 3);
  59. + memset(hex_buf, 0, 3);
  60. memset(hex_buf, '0', 2);
  61. }
  62. else
  63. @@ -2759,8 +2759,8 @@ static void ParseContentListFile(char *f
  64. }
  65. /* clear the line and rule buffers */
  66. - bzero((char *) buf, STD_BUF);
  67. - bzero((char *) rule_buf, STD_BUF);
  68. + memset((char *) buf, 0, STD_BUF);
  69. + memset((char *) rule_buf, 0, STD_BUF);
  70. frazes_count = 0;
  71. /* loop thru each list_file line and content to the rule */