Skip to content

Commit 65dea0b

Browse files
authored
Merge pull request #13074 from MathiasVP/13041-follow-up
C++: Add QLDoc to `getOverflow`
2 parents 3d713ed + 2021f46 commit 65dea0b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cpp/ql/src/experimental/Likely Bugs/OverrunWriteProductFlow.ql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ module StringSizeConfig implements ProductFlow::StateConfigSig {
134134

135135
module StringSizeFlow = ProductFlow::GlobalWithState<StringSizeConfig>;
136136

137+
/**
138+
* Gets the maximum number of elements accessed past the buffer `buffer` by the formatting
139+
* function call `c` when an overflow is detected starting at the `(source1, source2)` pair
140+
* and ending at the `(sink1, sink2)` pair.
141+
*
142+
* Implementation note: Since the number of elements accessed past the buffer is computed
143+
* using a `FlowState` on the second component of the `DataFlow::PathNode` pair we project
144+
* the columns down to the underlying `DataFlow::Node` in order to deduplicate the flow
145+
* state.
146+
*/
137147
int getOverflow(
138148
DataFlow::Node source1, DataFlow::Node source2, DataFlow::Node sink1, DataFlow::Node sink2,
139149
CallInstruction c, Expr buffer

0 commit comments

Comments
 (0)