* commit 'ba104fb7f1f0acad99a0d3a1cf7153aab57ea450': Fix overflow in adb_client
This commit is contained in:
commit
cd072e94cf
1 changed files with 2 additions and 2 deletions
|
|
@ -228,7 +228,7 @@ int adb_connect(const char *service)
|
||||||
} else {
|
} else {
|
||||||
// if server was running, check its version to make sure it is not out of date
|
// if server was running, check its version to make sure it is not out of date
|
||||||
char buf[100];
|
char buf[100];
|
||||||
int n;
|
size_t n;
|
||||||
int version = ADB_SERVER_VERSION - 1;
|
int version = ADB_SERVER_VERSION - 1;
|
||||||
|
|
||||||
// if we have a file descriptor, then parse version result
|
// if we have a file descriptor, then parse version result
|
||||||
|
|
@ -237,7 +237,7 @@ int adb_connect(const char *service)
|
||||||
|
|
||||||
buf[4] = 0;
|
buf[4] = 0;
|
||||||
n = strtoul(buf, 0, 16);
|
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;
|
if(readx(fd, buf, n)) goto error;
|
||||||
adb_close(fd);
|
adb_close(fd);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue