projects
/
platform
/
upstream
/
openconnect.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a443fad
)
Allocate extra byte for NUL termination after HTTP 1.0 read loop, not in it.
author
Adam Piątyszek
<ediap@users.sourceforge.net>
Fri, 12 Feb 2010 21:48:08 +0000
(22:48 +0100)
committer
David Woodhouse
<David.Woodhouse@intel.com>
Mon, 22 Feb 2010 14:08:27 +0000
(14:08 +0000)
Signed-off-by: Adam Piątyszek <ediap@users.sourceforge.net>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
http.c
patch
|
blob
|
history
diff --git
a/http.c
b/http.c
index
5a98a6d
..
2072001
100644
(file)
--- a/
http.c
+++ b/
http.c
@@
-268,10
+268,12
@@
static int process_http_response(struct openconnect_info *vpninfo, int *result,
/* HTTP 1.0 response. Just eat all we can in 16KiB chunks */
while (1) {
- body = realloc(body, done + 1638
5
);
+ body = realloc(body, done + 1638
4
);
i = SSL_read(vpninfo->https_ssl, body + done, 16384);
- if (i <= 0)
+ if (i <= 0) {
+ body = realloc(body, done + 1);
break;
+ }
done += i;
}
}