[PATCH] D94872: [NFC][AIX][XCOFF] Fix compile warning on strncpy
David Tenty via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 18 09:32:30 PST 2021
daltenty added inline comments.
================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:147
+ assert(strlen(N) <= XCOFF::NameSize && "section name too long");
+ memcpy(Name, N, strlen(N));
}
----------------
It's not clear this is properly null terminated in the other cases. Perhaps we should zero-initialize this field first (especially since we're going to write out the bytes directly)?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94872/new/
https://reviews.llvm.org/D94872
More information about the llvm-commits
mailing list