mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-22 04:03:11 +00:00
Avoid strncpy in malloc_strcpy
Signed-off-by: orbisai0security <>
This commit is contained in:
committed by
Guangli Dai
parent
be2de8ccd8
commit
1ffd5e96d6
@@ -105,8 +105,7 @@ buferror(int err, char *buf, size_t buflen) {
|
||||
&& defined(_GNU_SOURCE)
|
||||
char *b = strerror_r(err, buf, buflen);
|
||||
if (b != buf) {
|
||||
strncpy(buf, b, buflen);
|
||||
buf[buflen - 1] = '\0';
|
||||
malloc_snprintf(buf, buflen, "%s", b);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user