summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-01-14 20:33:50 +0100
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-01-14 20:33:50 +0100
commit010d9d7e928b6ceef3ea049894098169d1af3d42 (patch)
tree74e4744e9864a9953b6553b313b684680b218e31
parent[automerger skipped] Import translations. DO NOT MERGE am: 7851fab973 -s ours am: 9f84418306 -s ours (diff)
parentMerge "Fix ioctl FIONREAD call parameters to use int instead of size_t" am: b17cdb26df am: 7e1af2dd40 (diff)
downloadandroid_bootable_recovery-010d9d7e928b6ceef3ea049894098169d1af3d42.tar
android_bootable_recovery-010d9d7e928b6ceef3ea049894098169d1af3d42.tar.gz
android_bootable_recovery-010d9d7e928b6ceef3ea049894098169d1af3d42.tar.bz2
android_bootable_recovery-010d9d7e928b6ceef3ea049894098169d1af3d42.tar.lz
android_bootable_recovery-010d9d7e928b6ceef3ea049894098169d1af3d42.tar.xz
android_bootable_recovery-010d9d7e928b6ceef3ea049894098169d1af3d42.tar.zst
android_bootable_recovery-010d9d7e928b6ceef3ea049894098169d1af3d42.zip
-rw-r--r--minui/events.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/minui/events.cpp b/minui/events.cpp
index f331ed68a..87f811225 100644
--- a/minui/events.cpp
+++ b/minui/events.cpp
@@ -90,9 +90,11 @@ static int inotify_cb(int fd, __unused uint32_t epevents) {
// The inotify will put one or several complete events.
// Should not read part of one event.
- size_t event_len;
- int ret = ioctl(fd, FIONREAD, &event_len);
+ int event_len_int;
+ int ret = ioctl(fd, FIONREAD, &event_len_int);
if (ret != 0) return -1;
+ if (event_len_int < 0) return -1;
+ size_t event_len = event_len_int;
std::unique_ptr<DIR, decltype(&closedir)> dir(opendir(INPUT_DEV_DIR), closedir);
if (!dir) {