summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich2013-12-10 14:29:05 -0600
committerAndroid Git Automerger2013-12-10 14:29:05 -0600
commit54a80bcf88060b21f527c631c7ec911171bdb13f (patch)
tree3824e38466dde283759228f09b19c63f0c0925a4
parenta56b0b97ddd64a9558975c470ea6d09b4f10575e (diff)
parentcd072e94cf7e546cd6d333cd65641edcd69402b7 (diff)
downloadplatform-system-core-54a80bcf88060b21f527c631c7ec911171bdb13f.tar.gz
platform-system-core-54a80bcf88060b21f527c631c7ec911171bdb13f.tar.xz
platform-system-core-54a80bcf88060b21f527c631c7ec911171bdb13f.zip
am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit 'cd072e94cf7e546cd6d333cd65641edcd69402b7': Fix overflow in adb_client
-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 8340738c9..af87d2acb 100644
--- a/adb/adb_client.c
+++ b/adb/adb_client.c
@@ -241,7 +241,7 @@ int adb_connect(const char *service)
241 } else { 241 } else {
242 // if server was running, check its version to make sure it is not out of date 242 // if server was running, check its version to make sure it is not out of date
243 char buf[100]; 243 char buf[100];
244 int n; 244 size_t n;
245 int version = ADB_SERVER_VERSION - 1; 245 int version = ADB_SERVER_VERSION - 1;
246 246
247 // if we have a file descriptor, then parse version result 247 // if we have a file descriptor, then parse version result
@@ -250,7 +250,7 @@ int adb_connect(const char *service)
250 250
251 buf[4] = 0; 251 buf[4] = 0;
252 n = strtoul(buf, 0, 16); 252 n = strtoul(buf, 0, 16);
253 if(n > (int)sizeof(buf)) goto error; 253 if(n > sizeof(buf)) goto error;
254 if(readx(fd, buf, n)) goto error; 254 if(readx(fd, buf, n)) goto error;
255 adb_close(fd); 255 adb_close(fd);
256 256