mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 13:53: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)
|
&& defined(_GNU_SOURCE)
|
||||||
char *b = strerror_r(err, buf, buflen);
|
char *b = strerror_r(err, buf, buflen);
|
||||||
if (b != buf) {
|
if (b != buf) {
|
||||||
strncpy(buf, b, buflen);
|
malloc_snprintf(buf, buflen, "%s", b);
|
||||||
buf[buflen - 1] = '\0';
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user