Skip to content

Commit 803ae08

Browse files
committed
Http fixes potential null dereference.
* NOTE: this might not works if we don't have the remote idea of our ip. * Let's try it with a fake local ip. * credits goes to coverity for this one.
1 parent fae6181 commit 803ae08

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/http.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,10 @@ static int parse_xml_config(struct tunnel *tunnel, const char *buffer)
874874
log_warn("No gateway address, using interface for routing\n");
875875

876876
if (tunnel->config->tun) {
877-
tunnel->ipv4.ip_addr.s_addr = inet_addr(gateway);
877+
if (!gateway)
878+
tunnel->ipv4.ip_addr.s_addr = inet_addr("192.0.2.2");
879+
else
880+
tunnel->ipv4.ip_addr.s_addr = inet_addr(gateway);
878881
tunnel->ipv4.peer_addr.s_addr = inet_addr("192.0.2.1");
879882
}
880883

0 commit comments

Comments
 (0)