summaryrefslogtreecommitdiffstats
path: root/lib/libcompat
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-02-16 21:35:29 +0000
committerpfg <pfg@FreeBSD.org>2015-02-16 21:35:29 +0000
commit23ff0c84ba730f13f258ea812d73c6f7ec4f50a2 (patch)
tree6b4a2cf3c59a92cf1b7bef4808a87cdfc1e5be26 /lib/libcompat
parentb5f65ef8678ef13a4b4b501127267f6b033be51a (diff)
downloadFreeBSD-src-23ff0c84ba730f13f258ea812d73c6f7ec4f50a2.zip
FreeBSD-src-23ff0c84ba730f13f258ea812d73c6f7ec4f50a2.tar.gz
rexec(3): prevent uninitialized access to "port" variable.
CID: 1018716 (and clang static checker)
Diffstat (limited to 'lib/libcompat')
-rw-r--r--lib/libcompat/4.3/rexec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcompat/4.3/rexec.c b/lib/libcompat/4.3/rexec.c
index 4e01eb6..92357aa 100644
--- a/lib/libcompat/4.3/rexec.c
+++ b/lib/libcompat/4.3/rexec.c
@@ -332,10 +332,10 @@ retry:
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;
OpenPOWER on IntegriCloud