summaryrefslogtreecommitdiff
path: root/gweb
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-04-01 14:59:44 (GMT)
committerSamuel Ortiz <sameo@linux.intel.com>2011-04-01 14:59:44 (GMT)
commit3053441f5c3338d7c4dc635ab268dc954ea77624 (patch)
tree57197d87399ebd745a2256abf69ff0f672b7c8d4 /gweb
parent262dcd410358c47099ff7015512e34626e0007d3 (diff)
downloadconnman-3053441f5c3338d7c4dc635ab268dc954ea77624.zip
connman-3053441f5c3338d7c4dc635ab268dc954ea77624.tar.gz
connman-3053441f5c3338d7c4dc635ab268dc954ea77624.tar.bz2
gweb: Add port string to getaddrinfo
Without doing so, the socket address returned will have its port field uninitialized. Fixes BMC#14753 Fixes BMC#15026
Diffstat (limited to 'gweb')
-rw-r--r--gweb/gweb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gweb/gweb.c b/gweb/gweb.c
index 1bb1c70..75e64d9 100644
--- a/gweb/gweb.c
+++ b/gweb/gweb.c
@@ -1049,6 +1049,7 @@ static void resolv_result(GResolvResultStatus status,
{
struct web_session *session = user_data;
struct addrinfo hints;
+ char *port;
int ret;
if (results == NULL || results[0] == NULL) {
@@ -1066,7 +1067,9 @@ static void resolv_result(GResolvResultStatus status,
session->addr = NULL;
}
- ret = getaddrinfo(results[0], NULL, &hints, &session->addr);
+ port = g_strdup_printf("%u", session->port);
+ ret = getaddrinfo(results[0], port, &hints, &session->addr);
+ g_free(port);
if (ret != 0 || session->addr == NULL) {
call_result_func(session, 400);
return;