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

Skip to content

Commit 4dd3677

Browse files
committed
C++: Remove UsingStrcpyAsBoolean.ql duplicates
1 parent 3a6a515 commit 4dd3677

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ from FunctionCall func, Expr expr1, string msg
7979
where
8080
(
8181
isStringCopyCastedAsBoolean(func, expr1, msg) and
82-
not isStringCopyUsedInLogicalOperationOrCondition(func, expr1, _)
82+
not isStringCopyUsedInLogicalOperationOrCondition(func, _, _)
8383
)
8484
or
8585
isStringCopyUsedInLogicalOperationOrCondition(func, expr1, msg)

cpp/ql/test/query-tests/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean/UsingStrcpyAsBoolean.expected

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
| test.c:64:14:64:40 | ... != ... | Return value of strcpy used in a logical operation. |
1111
| test.cpp:75:9:75:14 | call to strcpy | Return value of strcpy used directly in a conditional expression. |
1212
| test.cpp:79:9:79:31 | ! ... | Return value of strcpy used in a logical operation. |
13-
| test.cpp:79:10:79:15 | call to strcpy | Return value of strcpy used as Boolean. |
1413
| test.cpp:83:9:83:35 | ... == ... | Return value of strcpy used in a logical operation. |
1514
| test.cpp:87:9:87:48 | ... && ... | Return value of strcpy used in a logical operation. |
16-
| test.cpp:87:27:87:32 | call to strcpy | Return value of strcpy used as Boolean. |
1715
| test.cpp:91:9:91:37 | call to wcscpy | Return value of wcscpy used directly in a conditional expression. |
1816
| test.cpp:95:9:95:14 | call to wcscpy | Return value of wcscpy used directly in a conditional expression. |
1917
| test.cpp:99:9:99:15 | call to _mbscpy | Return value of _mbscpy used directly in a conditional expression. |
@@ -24,11 +22,8 @@
2422
| test.cpp:119:9:119:18 | call to _wcsncpy_l | Return value of _wcsncpy_l used directly in a conditional expression. |
2523
| test.cpp:123:9:123:18 | call to _mbsncpy_l | Return value of _mbsncpy_l used directly in a conditional expression. |
2624
| test.cpp:127:9:127:37 | ! ... | Return value of strncpy used in a logical operation. |
27-
| test.cpp:127:10:127:16 | call to strncpy | Return value of strncpy used as Boolean. |
2825
| test.cpp:131:14:131:20 | call to strncpy | Return value of strncpy used as Boolean. |
2926
| test.cpp:133:19:133:47 | ! ... | Return value of strncpy used in a logical operation. |
30-
| test.cpp:133:20:133:26 | call to strncpy | Return value of strncpy used as Boolean. |
31-
| test.cpp:135:14:135:19 | call to strcpy | Return value of strcpy used as Boolean. |
3227
| test.cpp:135:14:135:40 | ... && ... | Return value of strcpy used in a logical operation. |
3328
| test.cpp:137:14:137:40 | ... == ... | Return value of strcpy used in a logical operation. |
3429
| test.cpp:139:14:139:40 | ... != ... | Return value of strcpy used in a logical operation. |

0 commit comments

Comments
 (0)