diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index 7a0fb71a..d4900bb0 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -502,7 +502,9 @@ bool ExploitabilityLinux::DisassembleBytes(const string& architecture, unlink(raw_bytes_tmpfile); return false; } - if (write(raw_bytes_fd, raw_bytes, raw_bytes_len) != raw_bytes_len) { + // Casting raw_bytes_len to `ssize_t` won't cause a sign flip, since we check + // its bounds above. + if (write(raw_bytes_fd, raw_bytes, raw_bytes_len) != (ssize_t)raw_bytes_len) { BPLOG(ERROR) << "Writing of raw bytes failed."; unlink(raw_bytes_tmpfile); return false;