We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3295d5c commit bf84f3aCopy full SHA for bf84f3a
cpp/ql/test/query-tests/Security/CWE/CWE-843/test.cpp
@@ -189,4 +189,24 @@ void test15() {
189
UInt8_with_more* u8 = (UInt8_with_more*)u64; // BAD
190
}
191
192
-// semmle-extractor-options: --gcc -std=c++11
+struct SingleInt {
193
+ int i;
194
+} __attribute__((packed));;
195
+
196
+struct PairInts {
197
+ int x, y;
198
199
200
+union MyUnion
201
+{
202
+ PairInts p;
203
+ unsigned long long foo;
204
+} __attribute__((packed));
205
206
+void test16() {
207
+ void* si = new SingleInt;
208
+ // ...
209
+ MyUnion* mu = (MyUnion*)si; // BAD [NOT DETECTED]
210
+}
211
212
+// semmle-extractor-options: --gcc -std=c++11
0 commit comments