aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-12-10 10:18:10 -0800
committerNick Kralevich <nnk@google.com>2013-12-10 10:18:10 -0800
commite89e09dd2b9b42184973e3ade291186a2737bced (patch)
tree76b9e971108fe523b58bbdd9338df8a0c81a8ae4
parent5dc5bfefa078f2aded34f85db4613ba91ad49b76 (diff)
Fix overflow in adb_clientandroid-cts-4.1_r4
Change-Id: I7f8582bd8a69d61ce47d11a9ffd0e901fc371037 Credit: Joshua Drake Bug: 12060953
-rw-r--r--adb/adb_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/adb/adb_client.c b/adb/adb_client.c
index 9a812f0c..89eb4281 100644
--- a/adb/adb_client.c
+++ b/adb/adb_client.c
@@ -228,7 +228,7 @@ int adb_connect(const char *service)
} else {
// if server was running, check its version to make sure it is not out of date
char buf[100];
- int n;
+ size_t n;
int version = ADB_SERVER_VERSION - 1;
// if we have a file descriptor, then parse version result
@@ -237,7 +237,7 @@ int adb_connect(const char *service)
buf[4] = 0;
n = strtoul(buf, 0, 16);
- if(n > (int)sizeof(buf)) goto error;
+ if(n > sizeof(buf)) goto error;
if(readx(fd, buf, n)) goto error;
adb_close(fd);