1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
--- snort-2.8.5.1.orig/src/detection-plugins/sp_pattern_match.c 2009-08-10 22:41:44.000000000 +0200
+++ snort-2.8.5.1/src/detection-plugins/sp_pattern_match.c 2009-12-27 17:24:45.000000000 +0100
@@ -831,7 +831,7 @@ void PayloadSearchListInit(char *data, O
data++;
/* grab everything between the starting " and the end one */
- sptr = index(data, '"');
+ sptr = strchr(data, '"');
eptr = strrchr(data, '"');
if(sptr != NULL && eptr != NULL)
@@ -862,21 +862,21 @@ static char *PayloadExtractParameter(cha
char *quote_one = NULL, *quote_two = NULL;
char *comma = NULL;
- quote_one = index(data, '"');
+ quote_one = strchr(data, '"');
if (quote_one)
{
- quote_two = index(quote_one+1, '"');
+ quote_two = strchr(quote_one+1, '"');
while ( quote_two && quote_two[-1] == '\\' )
- quote_two = index(quote_two+1, '"');
+ quote_two = strchr(quote_two+1, '"');
}
if (quote_one && quote_two)
{
- comma = index(quote_two, ',');
+ comma = strchr(quote_two, ',');
}
else if (!quote_one)
{
- comma = index(data, ',');
+ comma = strchr(data, ',');
}
if (comma)
@@ -2016,7 +2016,7 @@ void ParsePattern(char *rule, OptTreeNod
PatternMatchData *ds_idx;
/* clear out the temp buffer */
- bzero(tmp_buf, MAX_PATTERN_SIZE);
+ memset(tmp_buf, 0, MAX_PATTERN_SIZE);
if(rule == NULL)
{
@@ -2035,7 +2035,7 @@ void ParsePattern(char *rule, OptTreeNod
}
/* find the start of the data */
- start_ptr = index(rule, '"');
+ start_ptr = strchr(rule, '"');
if(start_ptr != rule)
{
@@ -2089,7 +2089,7 @@ void ParsePattern(char *rule, OptTreeNod
dummy_end = (dummy_idx + size);
/* why is this buffer so small? */
- bzero(hex_buf, 3);
+ memset(hex_buf, 0, 3);
memset(hex_buf, '0', 2);
/* BEGIN BAD JUJU..... */
@@ -2204,7 +2204,7 @@ void ParsePattern(char *rule, OptTreeNod
strtol(hex_buf, (char **) NULL, 16)&0xFF;
dummy_size++;
- bzero(hex_buf, 3);
+ memset(hex_buf, 0, 3);
memset(hex_buf, '0', 2);
}
else
@@ -2759,8 +2759,8 @@ static void ParseContentListFile(char *f
}
/* clear the line and rule buffers */
- bzero((char *) buf, STD_BUF);
- bzero((char *) rule_buf, STD_BUF);
+ memset((char *) buf, 0, STD_BUF);
+ memset((char *) rule_buf, 0, STD_BUF);
frazes_count = 0;
/* loop thru each list_file line and content to the rule */
|