@@ -63,14 +63,24 @@ class XercesDOMParserClass extends Class {
63
63
* - A is 1 if `setDisableDefaultEntityResolution` is `true`, 0 otherwise.
64
64
* - B is 1 if `setCreateEntityReferenceNodes` is `true`, 0 otherwise.
65
65
*/
66
- predicate encodeXercesDOMFlowState ( string flowstate , int a , int b ) {
67
- flowstate = "XercesDOM-0-0" and a = 0 and b = 0
66
+ predicate encodeXercesDOMFlowState (
67
+ string flowstate , int disabledDefaultEntityResolution , int createEntityReferenceNodes
68
+ ) {
69
+ flowstate = "XercesDOM-0-0" and
70
+ disabledDefaultEntityResolution = 0 and
71
+ createEntityReferenceNodes = 0
68
72
or
69
- flowstate = "XercesDOM-0-1" and a = 0 and b = 1
73
+ flowstate = "XercesDOM-0-1" and
74
+ disabledDefaultEntityResolution = 0 and
75
+ createEntityReferenceNodes = 1
70
76
or
71
- flowstate = "XercesDOM-1-0" and a = 1 and b = 0
77
+ flowstate = "XercesDOM-1-0" and
78
+ disabledDefaultEntityResolution = 1 and
79
+ createEntityReferenceNodes = 0
72
80
or
73
- flowstate = "XercesDOM-1-1" and a = 1 and b = 1
81
+ flowstate = "XercesDOM-1-1" and
82
+ disabledDefaultEntityResolution = 1 and
83
+ createEntityReferenceNodes = 1
74
84
}
75
85
76
86
/**
@@ -99,14 +109,15 @@ class DisableDefaultEntityResolutionTranformer extends XXEFlowStateTranformer {
99
109
}
100
110
101
111
final override XXEFlowState transform ( XXEFlowState flowstate ) {
102
- exists ( int a , int b |
103
- encodeXercesDOMFlowState ( flowstate , a , b ) and
112
+ exists ( int disabledDefaultEntityResolution , int createEntityReferenceNodes |
113
+ encodeXercesDOMFlowState ( flowstate , disabledDefaultEntityResolution ,
114
+ createEntityReferenceNodes ) and
104
115
(
105
116
newValue .getValue ( ) .toInt ( ) = 1 and // true
106
- encodeXercesDOMFlowState ( result , 1 , b )
117
+ encodeXercesDOMFlowState ( result , 1 , createEntityReferenceNodes )
107
118
or
108
119
not newValue .getValue ( ) .toInt ( ) = 1 and // false or unknown
109
- encodeXercesDOMFlowState ( result , 0 , b )
120
+ encodeXercesDOMFlowState ( result , 0 , createEntityReferenceNodes )
110
121
)
111
122
)
112
123
}
@@ -131,14 +142,15 @@ class CreateEntityReferenceNodesTranformer extends XXEFlowStateTranformer {
131
142
}
132
143
133
144
final override XXEFlowState transform ( XXEFlowState flowstate ) {
134
- exists ( int a , int b |
135
- encodeXercesDOMFlowState ( flowstate , a , b ) and
145
+ exists ( int disabledDefaultEntityResolution , int createEntityReferenceNodes |
146
+ encodeXercesDOMFlowState ( flowstate , disabledDefaultEntityResolution ,
147
+ createEntityReferenceNodes ) and
136
148
(
137
149
newValue .getValue ( ) .toInt ( ) = 1 and // true
138
- encodeXercesDOMFlowState ( result , a , 1 )
150
+ encodeXercesDOMFlowState ( result , disabledDefaultEntityResolution , 1 )
139
151
or
140
152
not newValue .getValue ( ) .toInt ( ) = 1 and // false or unknown
141
- encodeXercesDOMFlowState ( result , a , 0 )
153
+ encodeXercesDOMFlowState ( result , disabledDefaultEntityResolution , 0 )
142
154
)
143
155
)
144
156
}
0 commit comments