Fix fread() check in ExploitabilityLinux.

This fread() call did not intend to always fill the buffer, so the
change in https://crrev.com/c/3872234 is incorrect. Revert that one line
change.

Change-Id: I3fbe38fce11c24aa77b39dc229c7c5ed2a8d6960
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3879289
Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Lei Zhang 2022-09-07 09:38:41 -07:00
parent e69677e93d
commit 00f76018cc

View File

@ -522,7 +522,7 @@ bool ExploitabilityLinux::DisassembleBytes(const string& architecture,
BPLOG(ERROR) << "Failed to call objdump."; BPLOG(ERROR) << "Failed to call objdump.";
return false; return false;
} }
if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) != buffer_len) { if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) <= 0) {
pclose(objdump_fp); pclose(objdump_fp);
unlink(raw_bytes_tmpfile); unlink(raw_bytes_tmpfile);
BPLOG(ERROR) << "Failed to read objdump output."; BPLOG(ERROR) << "Failed to read objdump output.";