Kristof Umann | 25e592e | 2019-04-17 19:56:40 +0000 | [diff] [blame^] | 1 | // RUN: %clang_analyze_cc1 %s -verify \ |
| 2 | // RUN: -analyzer-checker=security.insecureAPI |
| 3 | |
| 4 | void 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 | } |