Bug 136119 - ksysguardd segfaults when files are not readable
Summary: ksysguardd segfaults when files are not readable
Status: RESOLVED FIXED
Alias: None
Product: ksysguard
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-22 09:02 UTC by Andreas Hartmann
Modified: 2006-10-22 13:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Hartmann 2006-10-22 09:02:16 UTC
Version:           Unbekannt (using KDE 3.5.5, compiled sources)
Compiler:          Target: i686-pc-linux-gnu
OS:                Linux (i686) release 2.6.17.11-standard

The last patch 595928 (http://websvn.kde.org/branches/KDE/3.5/kdebase/ksysguard/ksysguardd/Linux/logfile.c?rev=595928&r1=465343&r2=595928) of logfile.c crashes ksysguardd, if a logfile doesn't exist (/var/log/kern.log, daemon.log e.g.) or if it isn't readable (/var/log/messages) by the user who starts ksysguardd.


Kind regards,
Andreas Hartmann
Comment 1 Bram Schoenmakers 2006-10-22 13:21:47 UTC
SVN commit 598023 by bram:

Move fclose() into a block where fp does exist.

BUG:136119



 M  +1 -2      logfile.c  


--- branches/KDE/3.5/kdebase/ksysguard/ksysguardd/Linux/logfile.c #598022:598023
@@ -59,9 +59,8 @@
     if ( ( fp = fopen( entry->path, "r" ) ) != NULL ) {
       snprintf( monitor, 1024, "logfiles/%s", entry->name );
       registerMonitor( monitor, "logfile", printLogFile, printLogFileInfo, sm );
+      fclose( fp );
     }
-
-    fclose( fp );
   }
 
   LogFiles = new_ctnr();