mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-06 11:47:28 +03:00
Avoid strncpy in malloc_strcpy
Signed-off-by: orbisai0security <>
This commit is contained in:
parent
be2de8ccd8
commit
1ffd5e96d6
1 changed files with 1 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue