durable_rules 2.0.23 → 2.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/librb/engine.rb +2 -2
- data/src/rules/events.c +1 -1
- data/src/rules/json.c +6 -0
- data/src/rules/regex.c +1 -1
- data/src/rules/rete.c +1 -0
- data/src/rules/rules.h +3 -1
- data/src/rules/state.c +11 -2
- data/src/rules/state.h +7 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd4b836b5afc54646b8214078c55d46acb9086fa
|
4
|
+
data.tar.gz: f1f76182fd9edad82893c4aeca5bc197cde019d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6db4753a711a5f409fcab98c1b8f28be7e38e457814c70c6328d7797aa27ddf7f8a4b8386adfb54a764b5cda17b35189f18d5363bb430bec6062903b9ccc2669
|
7
|
+
data.tar.gz: 43ca66890ebe866a3a7e3071191633951f22b83cfe9912e22aac6373e56538af22f30c0daeecc4340c5f8668d08e36b2e2fafdd9bfabad8e5efc07fdf8dc4148
|
data/librb/engine.rb
CHANGED
@@ -1083,7 +1083,7 @@ module Engine
|
|
1083
1083
|
|
1084
1084
|
timer = Timers::Group.new
|
1085
1085
|
|
1086
|
-
thread_lambda = -> c {
|
1086
|
+
thread_lambda = -> c, _t {
|
1087
1087
|
if @ruleset_list.empty?
|
1088
1088
|
timer.after 0.5, &thread_lambda
|
1089
1089
|
else
|
@@ -1116,7 +1116,7 @@ module Engine
|
|
1116
1116
|
|
1117
1117
|
timer = Timers::Group.new
|
1118
1118
|
|
1119
|
-
thread_lambda = -> c {
|
1119
|
+
thread_lambda = -> c, _t {
|
1120
1120
|
if @ruleset_list.empty?
|
1121
1121
|
timer.after 0.5, &thread_lambda
|
1122
1122
|
else
|
data/src/rules/events.c
CHANGED
@@ -1587,7 +1587,7 @@ static unsigned int isArrayMatch(ruleset *tree,
|
|
1587
1587
|
jsonProperty *currentProperty,
|
1588
1588
|
alpha *arrayAlpha,
|
1589
1589
|
unsigned char *propertyMatch) {
|
1590
|
-
|
1590
|
+
*propertyMatch = 0;
|
1591
1591
|
unsigned int result = RULES_OK;
|
1592
1592
|
if (currentProperty->type != JSON_ARRAY) {
|
1593
1593
|
return RULES_OK;
|
data/src/rules/json.c
CHANGED
@@ -132,6 +132,12 @@ unsigned int readNextArrayValue(char *start, char **first, char **last, unsigned
|
|
132
132
|
}
|
133
133
|
break;
|
134
134
|
case ST_OBJECT_PROP_VAL:
|
135
|
+
if (start[0] == ']') {
|
136
|
+
*first = start;
|
137
|
+
*last = start;
|
138
|
+
return PARSE_END;
|
139
|
+
}
|
140
|
+
|
135
141
|
return getValue(start, first, last, type);
|
136
142
|
break;
|
137
143
|
}
|
data/src/rules/regex.c
CHANGED
@@ -1260,7 +1260,7 @@ static unsigned int packGraph(state *start,
|
|
1260
1260
|
for (int i = 0; i < currentState->transitionsLength; ++ i) {
|
1261
1261
|
transition *currentTransition = ¤tState->transitions[i];
|
1262
1262
|
unsigned int currentTransitionSymbol = currentTransition->symbol;
|
1263
|
-
if (caseInsensitive) {
|
1263
|
+
if (caseInsensitive && currentTransitionSymbol != REGEX_DOT) {
|
1264
1264
|
currentTransitionSymbol = tolower(currentTransitionSymbol);
|
1265
1265
|
}
|
1266
1266
|
|
data/src/rules/rete.c
CHANGED
data/src/rules/rules.h
CHANGED
@@ -33,6 +33,8 @@
|
|
33
33
|
#define ERR_NO_ACTION_AVAILABLE 310
|
34
34
|
#define ERR_PROPERTY_NOT_FOUND 311
|
35
35
|
#define ERR_OPERATION_NOT_SUPPORTED 312
|
36
|
+
#define ERR_EVENT_MAX_OBJECT_SIZE 313
|
37
|
+
#define ERR_EVENT_MAX_OBJECT_PROPERTY_SIZE 314
|
36
38
|
#define ERR_PARSE_REGEX 501
|
37
39
|
#define ERR_REGEX_MAX_TRANSITIONS 502
|
38
40
|
#define ERR_REGEX_MAX_STATES 503
|
@@ -64,7 +66,7 @@ typedef struct handleEntry {
|
|
64
66
|
unsigned int nextEmptyEntry;
|
65
67
|
} handleEntry;
|
66
68
|
|
67
|
-
handleEntry handleEntries[MAX_HANDLES];
|
69
|
+
extern handleEntry handleEntries[MAX_HANDLES];
|
68
70
|
extern unsigned int firstEmptyEntry;
|
69
71
|
extern unsigned int lastEmptyEntry;
|
70
72
|
extern char entriesInitialized;
|
data/src/rules/state.c
CHANGED
@@ -1378,8 +1378,17 @@ unsigned int getObjectProperty(jsonObject *jo,
|
|
1378
1378
|
unsigned int setObjectProperty(jsonObject *jo,
|
1379
1379
|
unsigned int hash,
|
1380
1380
|
unsigned char type,
|
1381
|
-
unsigned
|
1382
|
-
unsigned
|
1381
|
+
unsigned int valueOffset,
|
1382
|
+
unsigned int valueLength) {
|
1383
|
+
|
1384
|
+
if (valueLength >= MAX_OBJECT_PROPERTY_SIZE) {
|
1385
|
+
return ERR_EVENT_MAX_OBJECT_PROPERTY_SIZE;
|
1386
|
+
}
|
1387
|
+
|
1388
|
+
if (valueOffset >= (MAX_OBJECT_SIZE - MAX_OBJECT_PROPERTY_SIZE)) {
|
1389
|
+
return ERR_EVENT_MAX_OBJECT_SIZE;
|
1390
|
+
}
|
1391
|
+
|
1383
1392
|
jsonProperty *property = &jo->properties[jo->propertiesLength];
|
1384
1393
|
++jo->propertiesLength;
|
1385
1394
|
if (jo->propertiesLength == MAX_OBJECT_PROPERTIES) {
|
data/src/rules/state.h
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
#include <time.h>
|
2
|
+
#include <time.h>
|
3
3
|
|
4
4
|
#define HASH_ID 926444256
|
5
5
|
#define HASH_SID 3593476751
|
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
#define UNDEFINED_HASH_OFFSET 0
|
20
20
|
#define MAX_OBJECT_PROPERTIES 255
|
21
|
+
#define MAX_OBJECT_SIZE 4294967296
|
22
|
+
#define MAX_OBJECT_PROPERTY_SIZE 16777216
|
21
23
|
#define MAX_MESSAGE_FRAMES 16
|
22
24
|
#define MAX_MESSAGE_INDEX_LENGTH 512
|
23
25
|
#define MAX_LEFT_FRAME_INDEX_LENGTH 512
|
@@ -64,8 +66,8 @@ typedef struct pool {
|
|
64
66
|
typedef struct jsonProperty {
|
65
67
|
unsigned int hash;
|
66
68
|
unsigned char type;
|
67
|
-
unsigned
|
68
|
-
unsigned
|
69
|
+
unsigned int valueOffset;
|
70
|
+
unsigned int valueLength;
|
69
71
|
union {
|
70
72
|
long long i;
|
71
73
|
double d;
|
@@ -193,8 +195,8 @@ unsigned int getObjectProperty(jsonObject *jo,
|
|
193
195
|
unsigned int setObjectProperty(jsonObject *jo,
|
194
196
|
unsigned int hash,
|
195
197
|
unsigned char type,
|
196
|
-
unsigned
|
197
|
-
unsigned
|
198
|
+
unsigned int valueOffset,
|
199
|
+
unsigned int valueLength);
|
198
200
|
|
199
201
|
unsigned int constructObject(char *root,
|
200
202
|
char *parentName,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: durable_rules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesus Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|