[cfe-commits] r144645 - /cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp
Benjamin Kramer
benny.kra at googlemail.com
Tue Nov 15 04:54:53 PST 2011
Author: d0k
Date: Tue Nov 15 06:54:53 2011
New Revision: 144645
URL: http://llvm.org/viewvc/llvm-project?rev=144645&view=rev
Log:
Validate DiagGroup names in TableGen, they're used as command line arguments so we don't want shell meta chars in there.
Modified:
cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp
Modified: cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp?rev=144645&r1=144644&r2=144645&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Tue Nov 15 06:54:53 2011
@@ -303,6 +303,10 @@
OS << " { ";
OS << I->first.size() << ", ";
OS << "\"";
+ if (I->first.find_first_not_of("abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789!@#$%^*-+=:?")!=std::string::npos)
+ throw "Invalid character in diagnostic group '" + I->first + "'";
OS.write_escaped(I->first) << "\","
<< std::string(MaxLen-I->first.size()+1, ' ');
More information about the cfe-commits
mailing list