summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorIvan Lozano <ivanlozano@google.com>2018-01-03 23:34:04 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-01-03 23:34:04 +0000
commit6f1f7b988255db1162033c7a4bd26a92c507dcf3 (patch)
tree416c5930f571258d9be1488d6e2d2f7df8229600 /libs
parent28b48f29d5c76f1ef097904d3bc3c5c0cd5dadb2 (diff)
parent0ace760df7cb2983ea1d799bdbb4f5239cf115b8 (diff)
downloadnative-6f1f7b988255db1162033c7a4bd26a92c507dcf3.tar.gz
Merge "Fix sanitizer in ISensorService list functions."
Diffstat (limited to 'libs')
-rw-r--r--libs/sensor/ISensorServer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/sensor/ISensorServer.cpp b/libs/sensor/ISensorServer.cpp
index f20668d1e9..efbbf7d826 100644
--- a/libs/sensor/ISensorServer.cpp
+++ b/libs/sensor/ISensorServer.cpp
@@ -63,7 +63,8 @@ public:
Vector<Sensor> v;
uint32_t n = reply.readUint32();
v.setCapacity(n);
- while (n--) {
+ while (n) {
+ n--;
reply.read(s);
v.add(s);
}
@@ -80,7 +81,8 @@ public:
Vector<Sensor> v;
uint32_t n = reply.readUint32();
v.setCapacity(n);
- while (n--) {
+ while (n) {
+ n--;
reply.read(s);
v.add(s);
}