projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71b10ad
)
Avoid buffer overrun by "long" URLs.
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 28 Dec 2012 14:15:52 +0000
(15:15 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 28 Dec 2012 14:15:52 +0000
(15:15 +0100)
src/connection.c
patch
|
blob
|
history
diff --git
a/src/connection.c
b/src/connection.c
index
c1ff7d5
..
16ae64a
100644
(file)
--- a/
src/connection.c
+++ b/
src/connection.c
@@
-465,10
+465,11
@@
static int connection_connect(struct connection *con, iochan_man_t iochan_man)
if (sru && *sru && !strstr(host->url, "://"))
{
if (sru && *sru && !strstr(host->url, "://"))
{
- char http_hostport[512];
- strcpy(http_hostport, "http://");
- strcat(http_hostport, host->url);
- ZOOM_connection_connect(con->link, http_hostport, 0);
+ WRBUF w = wrbuf_alloc();
+ wrbuf_puts(w, "http://");
+ wrbuf_puts(w, host->url);
+ ZOOM_connection_connect(con->link, wrbuf_cstr(w), 0);
+ wrbuf_destroy(w);
}
else
{
}
else
{