From 049e7650a81866c4b32b8a5189780d0a4379ea44 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 2 Mar 2013 10:35:42 +0000 Subject: [PATCH] fsprobe: Get rid of unused hostname buffer When we copy the user supplied hostname into the fixed length hnamebuf array, we might overflow it. As we never use this buffer, just get rid of it. Caught by coverity (#985913) Reviewed-on: http://gerrit.openafs.org/9394 Reviewed-by: Marc Dionne Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit b32d92268f77608b57adf350d963941a94a31604) Change-Id: I09d119745dfdc9545af4912bd27f8ee09ccefd1f Reviewed-on: http://gerrit.openafs.org/11042 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Stephan Wiesand --- src/viced/fsprobe.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/viced/fsprobe.c b/src/viced/fsprobe.c index 8f19df9866..e6b014cc92 100644 --- a/src/viced/fsprobe.c +++ b/src/viced/fsprobe.c @@ -63,7 +63,6 @@ main(int argc, char **argv) struct sockaddr_in host; afs_int32 code; struct hostent *hp; - char hnamebuf[200]; struct timeval tv; int noAuth = 1; /* Default is authenticated connections */ @@ -78,9 +77,7 @@ main(int argc, char **argv) #ifdef STRUCT_SOCKADDR_HAS_SA_LEN host.sin_len = sizeof(struct sockaddr_in); #endif - if (host.sin_addr.s_addr != -1) { - strcpy(hnamebuf, av[0]); - } else { + if (host.sin_addr.s_addr == -1) { hp = gethostbyname(av[0]); if (hp) { host.sin_family = hp->h_addrtype;