Skip to content

Commit 066f836

Browse files
committed
C++: bcopy can never be in the std namespace.
1 parent a4d7bfb commit 066f836

File tree

1 file changed

+4
-4
lines changed
  • cpp/ql/src/semmle/code/cpp/models/implementations

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ private class MemcpyFunction extends ArrayFunction, DataFlowFunction, SideEffect
1818
// memcpy(dest, src, num)
1919
// memmove(dest, src, num)
2020
// memmove(dest, src, num, remaining)
21-
this.hasName(["memcpy", "memmove", "__builtin___memcpy_chk"])
21+
this.hasGlobalOrStdName(["memcpy", "memmove"])
2222
or
2323
// bcopy(src, dest, num)
24-
this.hasGlobalOrStdName("bcopy")
24+
this.hasGlobalName(["bcopy", "__builtin___memcpy_chk"])
2525
}
2626

2727
/**
2828
* Gets the index of the parameter that is the source buffer for the copy.
2929
*/
30-
int getParamSrc() { if this.hasGlobalOrStdName("bcopy") then result = 0 else result = 1 }
30+
int getParamSrc() { if this.hasGlobalName("bcopy") then result = 0 else result = 1 }
3131

3232
/**
3333
* Gets the index of the parameter that is the destination buffer for the
3434
* copy.
3535
*/
36-
int getParamDest() { if this.hasGlobalOrStdName("bcopy") then result = 1 else result = 0 }
36+
int getParamDest() { if this.hasGlobalName("bcopy") then result = 1 else result = 0 }
3737

3838
/**
3939
* Gets the index of the parameter that is the size of the copy (in bytes).

0 commit comments

Comments
 (0)