summaryrefslogtreecommitdiffstats
path: root/bin/rm
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2006-10-18 08:22:33 +0000
committermaxim <maxim@FreeBSD.org>2006-10-18 08:22:33 +0000
commitebbb5a25446a11e6f835a8a2b9e280fa9be98ed2 (patch)
tree5a92ddf165b4dfa0a9deef6bf7da540c40c7d9b6 /bin/rm
parent4e5d9f4895d485312766872cf9a016dd3956db68 (diff)
downloadFreeBSD-src-ebbb5a25446a11e6f835a8a2b9e280fa9be98ed2.zip
FreeBSD-src-ebbb5a25446a11e6f835a8a2b9e280fa9be98ed2.tar.gz
o Zero out struct stat before usage. lstat(2) can fail and
leave garbage there which will break -W code path. PR: bin/84569 Submitted by: Igor MFC after: 2 weeks
Diffstat (limited to 'bin/rm')
-rw-r--r--bin/rm/rm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 1ef6f38..7d02fa0 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -317,6 +317,7 @@ rm_file(char **argv)
int rval;
char *f;
+ bzero(&sb, sizeof(sb));
/*
* Remove a file. POSIX 1003.2 states that, by default, attempting
* to remove a directory is an error, so must always stat the file.
OpenPOWER on IntegriCloud