File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
cpp/ql/src/Security/CWE/CWE-732 Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,21 @@ int parseHex(string input) {
15
15
}
16
16
17
17
int o_creat ( ) {
18
- exists ( Macro m | m .getName ( ) = "O_CREAT" |
19
- result = parseHex ( m .getBody ( ) ) or result = UnixConstants:: parseOctal ( m .getBody ( ) )
20
- )
18
+ result =
19
+ unique( int v |
20
+ exists ( Macro m | m .getName ( ) = "O_CREAT" |
21
+ v = parseHex ( m .getBody ( ) ) or v = UnixConstants:: parseOctal ( m .getBody ( ) )
22
+ )
23
+ )
21
24
}
22
25
23
26
int o_tmpfile ( ) {
24
- exists ( Macro m | m .getName ( ) = "O_TMPFILE" |
25
- result = parseHex ( m .getBody ( ) ) or result = UnixConstants:: parseOctal ( m .getBody ( ) )
26
- )
27
+ result =
28
+ unique( int v |
29
+ exists ( Macro m | m .getName ( ) = "O_TMPFILE" |
30
+ v = parseHex ( m .getBody ( ) ) or v = UnixConstants:: parseOctal ( m .getBody ( ) )
31
+ )
32
+ )
27
33
}
28
34
29
35
bindingset [ n, digit]
You can’t perform that action at this time.
0 commit comments