Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5307be

Browse files
committed
C++: Replace 'use_data' with 'read_data'.
1 parent d6ccd63 commit c5307be

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,18 +369,18 @@ To set the stage, consider the following scenario:
369369
void read_data(const void *);
370370
void *malloc(size_t);
371371
372-
void get_input_and_use_data() {
372+
void get_input_and_read_data() {
373373
B b;
374374
b.a = (A *)malloc(sizeof(A));
375375
b.a->x = user_input();
376376
// ...
377-
use_data(&b);
377+
read_data(&b);
378378
free(b.a);
379379
}
380380
381-
We write a user-controlled value into the object ``b`` at the access path ``[a, x]``. Afterwards, ``b`` is passed to ``use_data`` which we assume we don't have the definition of in the database. We now want to track this user-input flowing into ``use_data``.
381+
We write a user-controlled value into the object ``b`` at the access path ``[a, x]``. Afterwards, ``b`` is passed to ``read_data`` which we assume we don't have the definition of in the database. We now want to track this user-input flowing into ``read_data``.
382382

383-
The dataflow library actually has a specific tool to handle this scenario, and thus we don't need to add any additional flow steps using ``isAdditionalFlowStep`` to handle this. Instead, we have to tell the dataflow library that ``use_data`` may implicitly read the data from the object that it has been passed. To do that, we implement ``allowImplicitRead`` in our dataflow module:
383+
The dataflow library actually has a specific tool to handle this scenario, and thus we don't need to add any additional flow steps using ``isAdditionalFlowStep`` to handle this. Instead, we have to tell the dataflow library that ``read_data`` may implicitly read the data from the object that it has been passed. To do that, we implement ``allowImplicitRead`` in our dataflow module:
384384

385385
.. code-block:: ql
386386

0 commit comments

Comments
 (0)