Skip to content

Commit 488ce15

Browse files
jf205shati-patelfelicitymay
authored
Apply suggestions from code review
Co-Authored-By: shati-patel <42641846+shati-patel@users.noreply.github.com> Co-Authored-By: Felicity Chapman <felicitymay@github.com>
1 parent 0b6592f commit 488ce15

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

docs/language/learn-ql/ql-training.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
CodeQL training and variant analysis examples
22
=============================================
33

4-
QL and variant analysis
5-
-----------------------
4+
CodeQL and variant analysis
5+
---------------------------
66

77
`Variant analysis <https://semmle.com/variant-analysis>`__ is the process of using a known vulnerability as a seed to find similar problems in your code. Security engineers typically perform variant analysis to identify possible vulnerabilities and to ensure that these threats are properly fixed across multiple code bases.
88

99
`CodeQL <https://semmle.com/ql>`__ is the code analysis engine that underpins LGTM, Semmle's community driven security analysis platform. Together, CodeQL and LGTM provide continuous monitoring and scalable variant analysis for your projects, even if you don’t have your own team of dedicated security engineers. You can read more about using CodeQL and LGTM in variant analysis in the `Semmle blog <https://blog.semmle.com/tags/variant-analysis>`__.
1010

1111
CodeQL is easy to learn, and exploring code using CodeQL is the most efficient way to perform variant analysis.
1212

13-
Learning QL for variant analysis
14-
--------------------------------
13+
Learning CodeQL for variant analysis
14+
------------------------------------
1515

1616
Start learning how to use CodeQL in variant analysis for a specific language by looking at the topics below. Each topic links to a short presentation on CodeQL, its libraries, or an example variant discovered using CodeQL.
1717

@@ -45,7 +45,7 @@ CodeQL and variant analysis for C/C++
4545
- `Introduction to local data flow <../ql-training/cpp/data-flow-cpp.html>`__–an introduction to analyzing local data flow in C/C++ using CodeQL, including an example demonstrating how to develop a query to find a real CVE.
4646
- `Exercise: snprintf overflow <../ql-training/cpp/snprintf.html>`__–an example demonstrating how to develop a data flow query.
4747
- `Introduction to global data flow <../ql-training/cpp/global-data-flow-cpp.html>`__–an introduction to analyzing global data flow in C/C++ using CodeQL.
48-
- `Analyzing control flow: CodeQL for C/C++ <../ql-training/cpp/control-flow-cpp.html>`__–an introduction to analyzing control flow in C/C++ using QL.
48+
- `Analyzing control flow: CodeQL for C/C++ <../ql-training/cpp/control-flow-cpp.html>`__–an introduction to analyzing control flow in C/C++ using CodeQL.
4949

5050
CodeQL and variant analysis for Java
5151
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -61,6 +61,6 @@ More resources
6161
~~~~~~~~~~~~~~
6262

6363
- If you are completely new to CodeQL, look at our introductory topics in :doc:`Learning CodeQL <index>`.
64-
- To find more detailed information about how to write CodeQL queries for specific languages, visit the links in :ref:`Writing CodeQL queries <writing-ql-queries>`.
64+
- To find more detailed information about how to write queries for specific languages, visit the links in :ref:`Writing CodeQL queries <writing-ql-queries>`.
6565
- To read more about how CodeQL queries have been used in Semmle's security research, and to read about new CodeQL developments, visit the `Semmle blog <https://blog.semmle.com>`__.
6666
- Find more examples of queries written by Semmle's own security researchers in the `Semmle Demos repository <https://github.com/semmle/demos>`__ on GitHub.

docs/language/ql-training/cpp/data-flow-cpp.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ Write a query that flags ``printf`` calls where the format argument is not a ``S
8282

8383
.. note::
8484

85-
This first query is about finding places where the format specifier is not a constant string. In CodeQL for C/C++, constant strings are modeled as ``StringLiteral`` nodes, so we are looking for calls to format functions where the format specifier argument is not a string literal.
85+
This first query is about finding places where the format specifier is not a constant string. In the CodeQL libraries for C/C++, constant strings are modeled as ``StringLiteral`` nodes, so we are looking for calls to format functions where the format specifier argument is not a string literal.
8686

87-
The `C/C++ standard libraries <https://help.semmle.com/qldoc/cpp/>`__ include many different formatting functions that may be vulnerable to this particular attack–including ``printf``, ``snprintf``, and others. Furthermore, each of these different formatting functions may include the format string in a different position in the argument list. Instead of laboriously listing all these different variants, we can make use of the CodeQL for C/C++ standard library class ``FormattingFunction``, which provides an interface that models common formatting functions in C/C++.
87+
The `C/C++ standard libraries <https://help.semmle.com/qldoc/cpp/>`__ include many different formatting functions that may be vulnerable to this particular attack–including ``printf``, ``snprintf``, and others. Furthermore, each of these different formatting functions may include the format string in a different position in the argument list. Instead of laboriously listing all these different variants, we can make use of the standard CodeQL class ``FormattingFunction``, which provides an interface that models common formatting functions in C/C++.
8888

8989
Meh...
9090
======

docs/language/ql-training/cpp/intro-ql-cpp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Each query library also implicitly defines a module.
108108

109109
Queries are always contained in query files with the file extension ``.ql``. `Quick queries <https://help.semmle.com/ql-for-eclipse/Content/WebHelp/quick-query.html>`__, run in `QL for Eclipse <https://help.semmle.com/ql-for-eclipse/Content/WebHelp/home-page.html>`__, are no exception: the quick query window maintains a temporary query file in the background.
110110

111-
Parts of queries can be lifted into `library files <https://help.semmle.com/QL/ql-handbook/modules.html#library-modules>`__ with the extension ``qll``. Definitions within such libraries can be brought into scope using ``import`` statements, and similarly QLL files can import each other’s definitions using “import” statements.
111+
Parts of queries can be lifted into `library files <https://help.semmle.com/QL/ql-handbook/modules.html#library-modules>`__ with the extension ``.qll``. Definitions within such libraries can be brought into scope using ``import`` statements, and similarly QLL files can import each other’s definitions using “import” statements.
112112

113113
Logic can be encapsulated as user-defined `predicates <https://help.semmle.com/QL/ql-handbook/predicates.html>`__ and `classes <https://help.semmle.com/QL/ql-handbook/types.html#classes>`__, and organized into `modules <https://help.semmle.com/QL/ql-handbook/modules.html>`__. Each QLL file implicitly defines a module, but QL and QLL files can also contain explicit module definitions, as we will see later.
114114

docs/language/ql-training/cpp/program-representation-cpp.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Working with functions
6464

6565
Functions are represented by the Function class. Each declaration or definition of a function is represented by a ``FunctionDeclarationEntry``.
6666

67-
Calls to functions are modeled by class Call and its subclasses:
67+
Calls to functions are modeled by class ``Call`` and its subclasses:
6868

6969
- ``Call.getTarget()`` gets the declared target of the call; undefined for calls through function pointers
7070
- ``Function.getACallToThisFunction()`` gets a call to this function
@@ -103,7 +103,7 @@ Working with macros
103103
#define square(x) x*x
104104
y = square(y0), z = square(z0)
105105
106-
is represented in the CodeQL database database as:
106+
is represented in the CodeQL database as:
107107

108108
- A Macro entity representing the text of the *head* and *body* of the macro
109109
- Assignment nodes, representing the two assignments after preprocessing
@@ -117,4 +117,4 @@ Useful predicates on ``Element``: ``isInMacroExpansion()``, ``isAffectedByMacro(
117117

118118
.. note::
119119

120-
The CodeQL database also contains information about macro definitions, which are represented by class ``Macro``. These macro definitions are related to the AST nodes resulting from their uses by the class ``MacroAccess``.
120+
The CodeQL database also contains information about macro definitions, which are represented by class ``Macro``. These macro definitions are related to the AST nodes resulting from their uses by the class ``MacroAccess``.

docs/language/ql-training/java/intro-ql-java.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Member predicates are inherited and can be overridden.
158158

159159
In the example, declaring a variable “EmptyBlock e” will allow it to range over only those blocks that have zero statements.
160160

161-
Classes in continued
161+
Classes continued
162162
=======================
163163

164164
.. container:: column-left

docs/language/ql-training/slide-snippets/intro-ql-general.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ QL is:
121121
- a **logic** language based on first-order logic
122122
- a **declarative** language without side effects
123123
- an **object-oriented** language
124-
- a **query** language working on a read-only CodeQL database database
124+
- a **query** language working on a read-only CodeQL database
125125
- equipped with rich standard libraries **for program analysis**
126126

127127
.. note::

0 commit comments

Comments
 (0)