From afa00abb2b68205bee539d7947130d6b1b1ec6e9 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 1 Apr 2021 19:39:14 +0200 Subject: Hardened entire system By using the nonnull attribute and replace buffer-overflow-prone functions like strcpy, strcat and sprintf by strlcpy, strlcat and snprintf. --- libs/libc/conv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/libc/conv.c') diff --git a/libs/libc/conv.c b/libs/libc/conv.c index 670fdb3..bb68d7b 100644 --- a/libs/libc/conv.c +++ b/libs/libc/conv.c @@ -105,7 +105,7 @@ char *itoa(int n) if (negative) { char *aux = (char *)malloc((u32)(sz + 2)); - strcpy(aux, ret); + strlcpy(aux, ret, sz + 2); aux[sz] = '-'; aux[sz + 1] = 0; free(ret); -- cgit v1.2.3