projects
/
oweals
/
uclient.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
52d955f
)
uclient-fetch: read_data_cb: fix a potential buffer overflow
author
Alexander Couzens
<lynxis@fe80.eu>
Sun, 11 Jun 2017 11:01:06 +0000
(13:01 +0200)
committer
Alexander Couzens
<lynxis@fe80.eu>
Sun, 11 Jun 2017 11:05:00 +0000
(13:05 +0200)
When a backend->read() is not implement or returns -1,
This -1 is interpreted as unsigned int resulting
in an access far behind the buffer.
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
uclient-fetch.c
patch
|
blob
|
history
diff --git
a/uclient-fetch.c
b/uclient-fetch.c
index d9582f55e2c1d46b78886ba22d2244be523f4554..dff144b22b7b3cd2d5982a615b9c2d68deab5042 100644
(file)
--- a/
uclient-fetch.c
+++ b/
uclient-fetch.c
@@
-262,7
+262,7
@@
static void read_data_cb(struct uclient *cl)
while (1) {
len = uclient_read(cl, buf, sizeof(buf));
- if (
!len
)
+ if (
len <= 0
)
return;
out_bytes += len;