summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich2013-12-10 14:17:45 -0600
committerAndroid Git Automerger2013-12-10 14:17:45 -0600
commit03d4eb29003a712c28733646588fafc8939fc1fe (patch)
treefc80cce6eecb8de305fa6dbdfc2907ca06d961d9
parent92b2cd23f708c9aeed146e995807dce080b57d1a (diff)
parentd63fb078aea697c536b19c03d29d4dde4ac087fc (diff)
downloadplatform-system-core-03d4eb29003a712c28733646588fafc8939fc1fe.tar.gz
platform-system-core-03d4eb29003a712c28733646588fafc8939fc1fe.tar.xz
platform-system-core-03d4eb29003a712c28733646588fafc8939fc1fe.zip
am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit 'd63fb078aea697c536b19c03d29d4dde4ac087fc': 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 9a812f0cf..89eb42813 100644
--- a/adb/adb_client.c
+++ b/adb/adb_client.c
@@ -228,7 +228,7 @@ int adb_connect(const char *service)
228 } else { 228 } else {
229 // if server was running, check its version to make sure it is not out of date 229 // if server was running, check its version to make sure it is not out of date
230 char buf[100]; 230 char buf[100];
231 int n; 231 size_t n;
232 int version = ADB_SERVER_VERSION - 1; 232 int version = ADB_SERVER_VERSION - 1;
233 233
234 // if we have a file descriptor, then parse version result 234 // if we have a file descriptor, then parse version result
@@ -237,7 +237,7 @@ int adb_connect(const char *service)
237 237
238 buf[4] = 0; 238 buf[4] = 0;
239 n = strtoul(buf, 0, 16); 239 n = strtoul(buf, 0, 16);
240 if(n > (int)sizeof(buf)) goto error; 240 if(n > sizeof(buf)) goto error;
241 if(readx(fd, buf, n)) goto error; 241 if(readx(fd, buf, n)) goto error;
242 adb_close(fd); 242 adb_close(fd);
243 243