mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
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 <marc.c.dionne@gmail.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> (cherry picked from commit b32d92268f77608b57adf350d963941a94a31604) Change-Id: I09d119745dfdc9545af4912bd27f8ee09ccefd1f Reviewed-on: http://gerrit.openafs.org/11042 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
parent
a5b40254de
commit
049e7650a8
@ -63,7 +63,6 @@ main(int argc, char **argv)
|
|||||||
struct sockaddr_in host;
|
struct sockaddr_in host;
|
||||||
afs_int32 code;
|
afs_int32 code;
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
char hnamebuf[200];
|
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
int noAuth = 1; /* Default is authenticated connections */
|
int noAuth = 1; /* Default is authenticated connections */
|
||||||
|
|
||||||
@ -78,9 +77,7 @@ main(int argc, char **argv)
|
|||||||
#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
|
#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
|
||||||
host.sin_len = sizeof(struct sockaddr_in);
|
host.sin_len = sizeof(struct sockaddr_in);
|
||||||
#endif
|
#endif
|
||||||
if (host.sin_addr.s_addr != -1) {
|
if (host.sin_addr.s_addr == -1) {
|
||||||
strcpy(hnamebuf, av[0]);
|
|
||||||
} else {
|
|
||||||
hp = gethostbyname(av[0]);
|
hp = gethostbyname(av[0]);
|
||||||
if (hp) {
|
if (hp) {
|
||||||
host.sin_family = hp->h_addrtype;
|
host.sin_family = hp->h_addrtype;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user