[Pkg-privacy-commits] [onioncat] 115/340: controller interfaces segfaulted due to error in listener list initialization
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:04:30 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository onioncat.
commit 69aef34db1a7998ad2a228a7ed6b2c5043624b57
Author: eagle <eagle at 58e1ccc2-750e-0410-8d0d-f93ca75ab447>
Date: Sat Jan 10 11:33:06 2009 +0000
controller interfaces segfaulted due to error in listener list initialization
git-svn-id: http://www.cypherpunk.at/svn/onioncat/trunk@427 58e1ccc2-750e-0410-8d0d-f93ca75ab447
---
src/ocatlibe.c | 2 +-
src/ocatsetup.c | 6 +++---
src/ocatv6conv.c | 1 +
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/ocatlibe.c b/src/ocatlibe.c
index 00d3328..b9ba778 100644
--- a/src/ocatlibe.c
+++ b/src/ocatlibe.c
@@ -142,7 +142,7 @@ void add_listener(const char *buf, const char *def)
CNF(oc_listen_cnt)++;
if (!(CNF(oc_listen) = realloc(CNF(oc_listen), sizeof(struct sockaddr*) * CNF(oc_listen_cnt))))
log_msg(LOG_ERR, "could not get memory for listener list: \"%s\"", strerror(errno)), exit(1);
- if (!(CNF(oc_listen_fd) = realloc(CNF(oc_listen), sizeof(int) * CNF(oc_listen_cnt))))
+ if (!(CNF(oc_listen_fd) = realloc(CNF(oc_listen_fd), sizeof(int) * CNF(oc_listen_cnt))))
log_msg(LOG_ERR, "could not get memory for listener fds: \"%s\"", strerror(errno)), exit(1);
if (!(CNF(oc_listen)[CNF(oc_listen_cnt) - 1] = calloc(1, sizeof(struct sockaddr_in6))))
diff --git a/src/ocatsetup.c b/src/ocatsetup.c
index cf51b3e..3f7c215 100644
--- a/src/ocatsetup.c
+++ b/src/ocatsetup.c
@@ -208,14 +208,14 @@ void print_setup_struct(FILE *f)
}
else
log_msg(LOG_WARNING, "could not convert struct sockaddr: \"%s\"", strerror(errno));
-
+
for (i = 0; i < CNF(oc_listen_cnt); i++)
{
if (inet_ntops(CNF(oc_listen)[i], &sas))
- fprintf(f, "oc_listen[%d] = %s:%d", i, sas.sstr_addr, ntohs(sas.sstr_port));
+ fprintf(f, "oc_listen[%d] = %s:%d\n", i, sas.sstr_addr, ntohs(sas.sstr_port));
else
log_msg(LOG_WARNING, "could not convert struct sockaddr: \"%s\"", strerror(errno));
- fprintf(f, "oc_listen_fd[%d] = %d", i, CNF(oc_listen_fd)[i]);
+ fprintf(f, "oc_listen_fd[%d] = %d\n", i, CNF(oc_listen_fd)[i]);
}
}
diff --git a/src/ocatv6conv.c b/src/ocatv6conv.c
index 3bb2d0d..ba9ee2f 100644
--- a/src/ocatv6conv.c
+++ b/src/ocatv6conv.c
@@ -147,6 +147,7 @@ const char *inet_ntops(const struct sockaddr *saddr, struct sockaddr_str *sas)
{
char *src;
+ log_debug("convert sockaddr %p to sockaddr_str %p", saddr, sas);
switch (saddr->sa_family)
{
case AF_INET:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncat.git
More information about the Pkg-privacy-commits
mailing list