diff options
author | Chris Lattner <sabre@nondot.org> | 2010-07-20 20:19:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-07-20 20:19:24 +0000 |
commit | 6c552c1d5f47fbba00e6268d96a26ad026f2da2a (patch) | |
tree | 0db7f53769c0611ae1901d17e402351a18eef312 /lib/Frontend/PCHReader.cpp | |
parent | f033f1da4a34f8df6e95e9929dc04ff54bb8fb01 (diff) |
implement rdar://5739832 - operator new should check for overflow in multiply,
causing clang to compile this code into something that correctly throws a
length error, fixing a potential integer overflow security attack:
void *test(long N) {
return new int[N];
}
int main() {
test(1L << 62);
}
We do this even when exceptions are disabled, because it is better for the
code to abort than for the attack to succeed.
This is heavily based on a patch that Fariborz wrote.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
0 files changed, 0 insertions, 0 deletions