1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/testdata/source-chars-bad.c
Douglas Bagnall c3194d0d65 test/bad_chars: ensure our tests could fail
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-11-17 04:36:36 +00:00

24 lines
481 B
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* "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
}