bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/19005] objcopy buffer-over-read


From: ams at sourceware dot org
Subject: [Bug binutils/19005] objcopy buffer-over-read
Date: Fri, 25 Sep 2015 16:54:58 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=19005

--- Comment #11 from Andrew Stubbs <ams at sourceware dot org> ---
My testcase was not really for reverse. I was trying to test for the buffer
overrun, but as that's UB there's no direct way to do it reliably. Testing
reverse was only meant to serve as an indicator that the the size count was
wrong.

It works because the input buffer size is known to be 3, and the output buffer
size is 6, so we can tell which one the --reverse option is being compared
against by whether there's an error message or not.

I considered having it work the other way round -- matching the input size and
check it was not an error -- but that would require having an even input size
which seemed like it could have by accident (alignment, etc.), whereas 3 is
always going to get padded.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]