"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/utils/js_identifier_ctx.cc" between
snort3-3.1.36.0.tar.gz and snort3-3.1.38.0.tar.gz

About: Snort 3 is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

js_identifier_ctx.cc  (snort3-3.1.36.0):js_identifier_ctx.cc  (snort3-3.1.38.0)
skipping to change at line 59 skipping to change at line 59
#define NORM_NAME_CNT 65536 #define NORM_NAME_CNT 65536
#define TYPE_NORMALIZED 1 #define TYPE_NORMALIZED 1
#define TYPE_IGNORED_ID 2 #define TYPE_IGNORED_ID 2
#define TYPE_IGNORED_PROP 4 #define TYPE_IGNORED_PROP 4
static char norm_names[NORM_NAME_SIZE * NORM_NAME_CNT]; static char norm_names[NORM_NAME_SIZE * NORM_NAME_CNT];
static void init_norm_names() static void init_norm_names()
{ {
static bool once = false;
if (once)
return;
once = true;
char* c = norm_names; char* c = norm_names;
const char hex[] = "0123456789abcdef"; const char hex[] = "0123456789abcdef";
for (int i = 0; i < NORM_NAME_CNT; ++i) for (int i = 0; i < NORM_NAME_CNT; ++i)
{ {
*c++ = 'v'; *c++ = 'v';
*c++ = 'a'; *c++ = 'a';
*c++ = 'r'; *c++ = 'r';
*c++ = '_'; *c++ = '_';
*c++ = hex[(i >> 12) & 0xf]; *c++ = hex[(i >> 12) & 0xf];
*c++ = hex[(i >> 8) & 0xf]; *c++ = hex[(i >> 8) & 0xf];
*c++ = hex[(i >> 4) & 0xf]; *c++ = hex[(i >> 4) & 0xf];
*c++ = hex[(i >> 0) & 0xf]; *c++ = hex[(i >> 0) & 0xf];
*c++ = '\0'; *c++ = '\0';
} }
assert(sizeof(norm_names) == c - norm_names); assert(sizeof(norm_names) == c - norm_names);
} }
static int _init_norm_names __attribute__((unused)) = (init_norm_names(), 0);
JSIdentifierCtx::JSIdentifierCtx(int32_t depth, uint32_t max_scope_depth, JSIdentifierCtx::JSIdentifierCtx(int32_t depth, uint32_t max_scope_depth,
const std::unordered_set<std::string>& ignored_ids_list, const std::unordered_set<std::string>& ignored_ids_list,
const std::unordered_set<std::string>& ignored_props_list) const std::unordered_set<std::string>& ignored_props_list)
: ignored_ids_list(ignored_ids_list), ignored_props_list(ignored_props_list) , : ignored_ids_list(ignored_ids_list), ignored_props_list(ignored_props_list) ,
max_scope_depth(max_scope_depth) max_scope_depth(max_scope_depth)
{ {
init_norm_names();
norm_name = norm_names; norm_name = norm_names;
norm_name_end = norm_names + NORM_NAME_SIZE * std::min(depth, NORM_NAME_CNT) ; norm_name_end = norm_names + NORM_NAME_SIZE * std::min(depth, NORM_NAME_CNT) ;
scopes.emplace_back(JSProgramScopeType::GLOBAL); scopes.emplace_back(JSProgramScopeType::GLOBAL);
init_ignored_names(); init_ignored_names();
} }
const char* JSIdentifierCtx::substitute(unsigned char c, bool is_property) const char* JSIdentifierCtx::substitute(unsigned char c, bool is_property)
{ {
auto p = id_fast[c]; auto p = id_fast[c];
 End of changes. 3 change blocks. 
9 lines changed or deleted 2 lines changed or added

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