summaryrefslogtreecommitdiffstats
path: root/testdata/source-chars-bad.c
blob: 9b435722e1366da0727275f2abd609db77b5b1e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * "Trojan Source"  CVE-2021-42574 test.
 *
 * Based on an example from https://lwn.net/Articles/874951/
 */
#include <stdio.h>

int main(int argc, char *argv[])
{
	int isAdmin = 0;

#if 0
	/* This is what is really there. */

	/*«RLO» } «LRI»if (isAdmin)«PDI» «LRI» begin admins only */
	puts("hello admin");
	/* end admin only «RLO» { «LRI»*/
#else
	/*‮ } ⁦if (isAdmin)⁩ ⁦ begin admins only */
	puts("hello admin");
	/* end admin only ‮ { ⁦*/
#endif
}