From: Simon Wilkinson Date: Sat, 2 Mar 2013 10:35:42 +0000 (+0000) Subject: fsprobe: Get rid of unused hostname buffer X-Git-Tag: upstream/1.8.0_pre1^2~1351 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b32d92268f77608b57adf350d963941a94a31604;p=packages%2Fo%2Fopenafs.git 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) Change-Id: I4cda6279cd667343856deeb425dceaf00f7904b6 Reviewed-on: http://gerrit.openafs.org/9394 Reviewed-by: Marc Dionne Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/viced/fsprobe.c b/src/viced/fsprobe.c index fa2e80d24..b23602301 100644 --- a/src/viced/fsprobe.c +++ b/src/viced/fsprobe.c @@ -59,7 +59,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 */ @@ -74,9 +73,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;