rexec(3): prevent uninitialized access to "port" variable.

CID:	1018716 (and clang static checker)
This commit is contained in:
pfg 2015-02-16 21:35:29 +00:00
parent b5f65ef867
commit 23ff0c84ba

View File

@ -332,10 +332,10 @@ rexec(ahost, rport, name, pass, cmd, fd2p)
perror(hp->h_name);
return (-1);
}
if (fd2p == 0) {
(void) write(s, "", 1);
port = 0;
} else {
port = 0;
if (fd2p == 0)
(void) write(s, "", 1);
else {
char num[8];
int s2, sin2len;