Use *array() allocation functions where appropriate

This prevents overflow from multiplication.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar authored and Serge Hallyn committed 2023-02-23 20:28:43 -06:00
1 parent 727275a027
commit 191f04f7dc
18 files changed
+26 -26

No files matched your search

+1 -1
View File
@@ -117,7 +117,7 @@ void endsgent (void)
size_t len = strlen (string) + 1;
if (len > sgrbuflen) {
char *buf = (char *) realloc (sgrbuf, sizeof (char) * len);
char *buf = (char *) reallocarray (sgrbuf, len, sizeof (char));
if (NULL == buf) {
return NULL;
}