Skip to content

Commit 34ece62

Browse files
fix: c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn security vulnerability
Automated security fix generated by Orbis Security AI
1 parent f2f4e5d commit 34ece62

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

deps/jemalloc/src/malloc_io.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ buferror(int err, char *buf, size_t buflen) {
9999
#elif defined(JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE) && defined(_GNU_SOURCE)
100100
char *b = strerror_r(err, buf, buflen);
101101
if (b != buf) {
102-
strncpy(buf, b, buflen);
103-
buf[buflen-1] = '\0';
102+
snprintf(buf, buflen, "%s", b);
104103
}
105104
return 0;
106105
#else

0 commit comments

Comments
 (0)