summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/KerneloopsScanner.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-11 12:09:57 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-11 12:09:57 +0100
commitedf6beb585dc38c365ccbdaae85756b2814e1329 (patch)
treec356fda7f3397c3b3427f56a5a1584cab7e513c5 /lib/Plugins/KerneloopsScanner.cpp
parent14ef0cfe72faf6696df3ef8f42927e9458ccbeeb (diff)
downloadabrt-edf6beb585dc38c365ccbdaae85756b2814e1329.tar.gz
abrt-edf6beb585dc38c365ccbdaae85756b2814e1329.tar.xz
abrt-edf6beb585dc38c365ccbdaae85756b2814e1329.zip
*: assorted fixes prompted by security analysis; more to come
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Plugins/KerneloopsScanner.cpp')
-rw-r--r--lib/Plugins/KerneloopsScanner.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp
index 128e083..f05f0d8 100644
--- a/lib/Plugins/KerneloopsScanner.cpp
+++ b/lib/Plugins/KerneloopsScanner.cpp
@@ -147,8 +147,10 @@ int CKerneloopsScanner::ScanSysLogFile(const char *filename)
if (fd < 0)
return 0;
statb.st_size = 0; /* paranoia */
- if (fstat(fd, &statb) != 0 || statb.st_size < 1)
+ if (fstat(fd, &statb) != 0 || statb.st_size < 1) {
+ close(fd);
return 0;
+ }
/*
* in theory there's a race here, since someone could spew