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:
a1177e5
)
Fix NULL ptr reference for HTTP proxy.
author
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 19 Mar 2009 12:32:13 +0000
(13:32 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 19 Mar 2009 12:32:54 +0000
(13:32 +0100)
The ser->host might be 0 in case attribute 'host' is not given for element
'listen' in configuration. This commit avoids referencing it in sprintf.
src/http.c
patch
|
blob
|
history
diff --git
a/src/http.c
b/src/http.c
index
86f8dc2
..
62233b2
100644
(file)
--- a/
src/http.c
+++ b/
src/http.c
@@
-794,7
+794,8
@@
static int http_proxy(struct http_request *rq)
hp = http_header_append(c, hp,
"X-Pazpar2-Server-Port", server_port);
sprintf(server_via, "1.1 %s:%s (%s/%s)",
- ser->host, server_port, PACKAGE_NAME, PACKAGE_VERSION);
+ ser->host ? ser->host : "@",
+ server_port, PACKAGE_NAME, PACKAGE_VERSION);
hp = http_header_append(c, hp, "Via" , server_via);
hp = http_header_append(c, hp, "X-Forwarded-For", c->addr);
}