blob: 25ce8b1b88232a3c40da0348d09164f428cfdc47 [file] [log] [blame]
Kristof Umann25e592e2019-04-17 19:56:40 +00001// RUN: %clang_analyze_cc1 %s -verify \
2// RUN: -analyzer-checker=security.insecureAPI
3
4void builtin_function_call_crash_fixes(char *c) {
5 __builtin_strncpy(c, "", 6); // expected-warning{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
6 __builtin_memset(c, '\0', (0)); // expected-warning{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard.}}
7 __builtin_memcpy(c, c, 0); // expected-warning{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
8}