diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-07-01 12:55:23 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-01 12:55:23 -0400 |
commit | 2ba19f9b4a052dcaa5ebd3c6a629e1ec67a595f9 (patch) | |
tree | 7f05139b1c751d534b12a43de0c234154bc93925 /src/or | |
parent | 2b5ebc70973b1c0dd62201908632733c0953a4ec (diff) | |
parent | 021cf3f0521375f1722a7fb82ce286086db79142 (diff) | |
download | tor-2ba19f9b4a052dcaa5ebd3c6a629e1ec67a595f9.tar.gz tor-2ba19f9b4a052dcaa5ebd3c6a629e1ec67a595f9.zip |
Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/connection.c | 8 | ||||
-rw-r--r-- | src/or/rendcommon.c | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index b2412a2a34..c791309d68 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -811,7 +811,13 @@ create_unix_sockaddr(const char *listenaddress, char **readable_address, sockaddr = tor_malloc_zero(sizeof(struct sockaddr_un)); sockaddr->sun_family = AF_UNIX; - strncpy(sockaddr->sun_path, listenaddress, sizeof(sockaddr->sun_path)); + if (strlcpy(sockaddr->sun_path, listenaddress, sizeof(sockaddr->sun_path)) + >= sizeof(sockaddr->sun_path)) { + log_warn(LD_CONFIG, "Unix socket path '%s' is too long to fit.", + escaped(listenaddress)); + tor_free(sockaddr); + return NULL; + } if (readable_address) *readable_address = tor_strdup(listenaddress); diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index 3b18bf6078..c5bf88163d 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -1041,6 +1041,7 @@ rend_cache_store(const char *desc, size_t desc_len, int published, log_warn(LD_REND, "Received service descriptor for service ID %s; " "expected descriptor for service ID %s.", query, safe_str(service_id)); + rend_service_descriptor_free(parsed); return -2; } now = time(NULL); |