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

CID:	1018716 (and clang static checker)
This commit is contained in:
Pedro F. Giffuni 2015-02-16 21:35:29 +00:00
parent 3122da88ca
commit 46bf2f5317
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278867

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;