Skip to content

Commit 6df8c84

Browse files
author
ripley
committed
avoid UBSAN warning on macOS
git-svn-id: https://svn.r-project.org/R/trunk@87486 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 99d5fe9 commit 6df8c84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/extra/intl/dcigettext.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,8 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
12521252
__libc_lock_lock (lock);
12531253

12541254
inbuf = (const unsigned char *) result;
1255-
outbuf = freemem + sizeof (size_t);
1255+
// avoid UBSAN warning on macOS
1256+
outbuf = freemem ? freemem + sizeof (size_t): freemem;
12561257

12571258
malloc_count = 0;
12581259
while (1)

0 commit comments

Comments
 (0)