| 1 | /** |
| 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | * SPDX-License-Identifier: Apache-2.0. |
| 4 | */ |
| 5 | |
| 6 | #undef memset |
| 7 | |
| 8 | #include <proof_helpers/nondet.h> |
| 9 | #include <stddef.h> |
| 10 | |
| 11 | /** |
| 12 | * Override the version of memset used by CBMC. |
| 13 | */ |
| 14 | void *memset_impl(void *s, int c, size_t n) { |
| 15 | __CPROVER_precondition(__CPROVER_w_ok(s, n), "memset destination region writeable"); |
| 16 | |
| 17 | return s; |
| 18 | } |
| 19 | |
| 20 | void *memset(void *s, int c, size_t n) { |
| 21 | return memset_impl(s, c, n); |
| 22 | } |
| 23 | |
| 24 | void *__builtin___memset_chk(void *s, int c, size_t n, size_t os) { |
| 25 | (void)os; |
| 26 | return memset_impl(s, c, n); |
| 27 | } |