diff options
Diffstat (limited to 'aes/src/error.c')
| -rw-r--r-- | aes/src/error.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/aes/src/error.c b/aes/src/error.c index 7c6594f..8de8a5d 100644 --- a/aes/src/error.c +++ b/aes/src/error.c @@ -43,7 +43,8 @@ static int c99_snprintf(char* dest, size_t dest_size, const char* fmt, ...) { #endif static void aes_fill_string(char* dest, size_t dest_size, const char* src) { - strncpy(dest, src, dest_size); + assert(dest_size != 0); + strncpy(dest, src, dest_size - 1); dest[dest_size - 1] = '\0'; } |
