mirror of
https://github.com/yuzu-emu/breakpad
synced 2024-11-26 08:58:11 +00:00
exploitability_linux: fix mismatched comparison warning
On ARM, this write fails to build: comparison of integers of different signs: 'ssize_t' (aka 'int') and 'const unsigned int' [-Werror,-Wsign-compare] Since we check that it's <= 15 above, we can simply cast it without issue. Bug: b:235999011 Change-Id: Id75fc0df74e88b347df615df06567e96c6b59a1d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3758800 Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
e9057e2d5e
commit
eb087c3383
1 changed files with 3 additions and 1 deletions
|
@ -502,7 +502,9 @@ bool ExploitabilityLinux::DisassembleBytes(const string& architecture,
|
||||||
unlink(raw_bytes_tmpfile);
|
unlink(raw_bytes_tmpfile);
|
||||||
return false;
|
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.";
|
BPLOG(ERROR) << "Writing of raw bytes failed.";
|
||||||
unlink(raw_bytes_tmpfile);
|
unlink(raw_bytes_tmpfile);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue