sp_react.c (snort-2.9.16.1) | : | sp_react.c (snort-2.9.17) | ||
---|---|---|---|---|
skipping to change at line 330 | skipping to change at line 330 | |||
if ( !sc ) | if ( !sc ) | |||
FatalError("react: %s(%d) Snort config for parsing is NULL.\n", | FatalError("react: %s(%d) Snort config for parsing is NULL.\n", | |||
file_name, file_line); | file_name, file_line); | |||
if ( s_page || !sc->react_page ) return; | if ( s_page || !sc->react_page ) return; | |||
if ( stat(sc->react_page, &fs) ) | if ( stat(sc->react_page, &fs) ) | |||
FatalError("react: %s(%d) can't stat react page file '%s'.\n", | FatalError("react: %s(%d) can't stat react page file '%s'.\n", | |||
file_name, file_line, sc->react_page); | file_name, file_line, sc->react_page); | |||
if ( fs.st_size < 2 ) | ||||
FatalError("react: react page %s size is not adequate.\n", | ||||
sc->react_page); | ||||
s_page = SnortAlloc(fs.st_size+1); | s_page = SnortAlloc(fs.st_size+1); | |||
fd = fopen(sc->react_page, "r"); | fd = fopen(sc->react_page, "r"); | |||
if ( !fd ) | if ( !fd ) | |||
FatalError("react: %s(%d) can't open react page file '%s'.\n", | FatalError("react: %s(%d) can't open react page file '%s'.\n", | |||
file_name, file_line, sc->react_page); | file_name, file_line, sc->react_page); | |||
n = fread(s_page, 1, fs.st_size, fd); | n = fread(s_page, 1, fs.st_size, fd); | |||
fclose(fd); | fclose(fd); | |||
if ( n != (size_t)fs.st_size ) | if ( n != (size_t)fs.st_size ) | |||
FatalError("react: %s(%d) can't load react page file '%s'.\n", | FatalError("react: %s(%d) can't load react page file '%s'.\n", | |||
file_name, file_line, sc->react_page); | file_name, file_line, sc->react_page); | |||
s_page[n] = '\0'; | s_page[n] = '\0'; | |||
msg = strstr(s_page, MSG_KEY); | msg = strstr(s_page, MSG_KEY); | |||
if ( msg ) strncpy(msg, "%s", 2); | if ( msg ) strncpy(msg, "%s", 2); | |||
// search for % | // search for % | |||
percent_s = strstr(s_page, MSG_PERCENT); | percent_s = strstr(s_page, MSG_PERCENT); | |||
if (percent_s) | if (percent_s) | |||
{ | { | |||
percent_s += strlen(MSG_PERCENT); // move past current | percent_s += strlen(MSG_PERCENT); // move past current | |||
// search for % again | // search for % again | |||
percent_s = strstr(percent_s, MSG_PERCENT); | percent_s = strstr(percent_s, MSG_PERCENT); | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 5 lines changed or added |