summaryrefslogtreecommitdiff
path: root/source4/lib/util_sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/util_sock.c')
-rw-r--r--source4/lib/util_sock.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/source4/lib/util_sock.c b/source4/lib/util_sock.c
index 42dc04f6c8..8362290804 100644
--- a/source4/lib/util_sock.c
+++ b/source4/lib/util_sock.c
@@ -439,7 +439,6 @@ static BOOL matchname(char *remotehost, struct in_addr addr)
char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
{
char *name_buf;
- char *addr_buf;
struct hostent *hp;
struct in_addr addr;
char *p;
@@ -457,8 +456,6 @@ char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
name_buf = talloc_strdup(mem_ctx, "UNKNOWN");
if (fd == -1) return name_buf;
- addr_buf = talloc_strdup(mem_ctx, p);
-
addr = *interpret_addr2(mem_ctx, p);
/* Look up the remote host name. */
@@ -473,7 +470,7 @@ char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
}
}
- alpha_strcpy(name_buf, name_buf, "_-.", sizeof(name_buf));
+ alpha_strcpy(name_buf, name_buf, "_-.", strlen(name_buf)+1);
if (strstr(name_buf,"..")) {
name_buf = talloc_strdup(mem_ctx, "UNKNOWN");
}