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

Skip to content

Commit 06e649f

Browse files
committed
C++: Add support for fgetws.
1 parent 5afebc8 commit 06e649f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

change-notes/1.24/analysis-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The following changes in version 1.24 affect C/C++ analysis in all applications.
4242
* The `LocalScopeVariableReachability` library is deprecated in favor of
4343
`StackVariableReachability`. The functionality is the same.
4444
* The models library models `strlen` in more detail, and includes common variations such as `wcslen`.
45-
* The models library models `gets` and `fgets`.
45+
* The models library models `gets` and similar functions.
4646
* The taint tracking library (`semmle.code.cpp.dataflow.TaintTracking`) has had
4747
the following improvements:
4848
* The library now models data flow through `strdup` and similar functions.

cpp/ql/src/semmle/code/cpp/models/implementations/Gets.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class GetsFunction extends DataFlowFunction, TaintFunction, ArrayFunction, Alias
1212
GetsFunction() {
1313
exists(string name | name = getName() |
1414
name = "gets" or // gets(str)
15-
name = "fgets" // fgets(str, num, stream)
15+
name = "fgets" or // fgets(str, num, stream)
16+
name = "fgetws" // fgetws(wstr, num, stream)
1617
)
1718
}
1819

0 commit comments

Comments
 (0)