[PATCH] D139315: [NFC][LLVM-MT] Fix buffer-overflow when comparing buffers
Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 04:52:45 PST 2022
jmmartinez updated this revision to Diff 480860.
jmmartinez added a comment.
Remove size comparison
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139315/new/
https://reviews.llvm.org/D139315
Files:
llvm/tools/llvm-mt/llvm-mt.cpp
Index: llvm/tools/llvm-mt/llvm-mt.cpp
===================================================================
--- llvm/tools/llvm-mt/llvm-mt.cpp
+++ llvm/tools/llvm-mt/llvm-mt.cpp
@@ -150,9 +150,9 @@
bool Same = false;
if (OutBuffOrErr) {
const std::unique_ptr<MemoryBuffer> &FileBuffer = *OutBuffOrErr;
- Same = std::equal(OutputBuffer->getBufferStart(),
- OutputBuffer->getBufferEnd(),
- FileBuffer->getBufferStart());
+ Same = std::equal(
+ OutputBuffer->getBufferStart(), OutputBuffer->getBufferEnd(),
+ FileBuffer->getBufferStart(), FileBuffer->getBufferEnd());
}
if (!Same) {
#if LLVM_ON_UNIX
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139315.480860.patch
Type: text/x-patch
Size: 697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221207/4476b240/attachment.bin>
More information about the llvm-commits
mailing list