projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1052c99
)
Fix global overflow in types::lookupTypeForTypeSpecifier.
author
Evgeniy Stepanov
<eugeni.stepanov@gmail.com>
Thu, 28 Feb 2013 07:53:32 +0000
(07:53 +0000)
committer
Evgeniy Stepanov
<eugeni.stepanov@gmail.com>
Thu, 28 Feb 2013 07:53:32 +0000
(07:53 +0000)
memcpy() is allowed to read entire contents of both memory areas.
Found with AddressSanitizer.
llvm-svn: 176237
clang/lib/Driver/Types.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Driver/Types.cpp
b/clang/lib/Driver/Types.cpp
index
cab6dcc
..
88574fc
100644
(file)
--- a/
clang/lib/Driver/Types.cpp
+++ b/
clang/lib/Driver/Types.cpp
@@
-168,12
+168,10
@@
types::ID types::lookupTypeForExtension(const char *Ext) {
}
types::ID types::lookupTypeForTypeSpecifier(const char *Name) {
- unsigned N = strlen(Name);
-
for (unsigned i=0; i<numTypes; ++i) {
types::ID Id = (types::ID) (i + 1);
if (canTypeBeUserSpecified(Id) &&
-
memcmp(Name, getInfo(Id).Name, N + 1
) == 0)
+
strcmp(Name, getInfo(Id).Name
) == 0)
return Id;
}