From fa94cac75f4bfd9f0213817fc426ecd3ecfa17ee Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Wed, 2 Apr 2008 02:12:57 +0000 Subject: [PATCH] * Fixed segfault when configuration doesn't contain TEXT block (thanks Pippijn). git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1098 7f574dfc-610e-0410-a909-a81674777703 --- ChangeLog | 4 ++++ src/conky.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index dfd95aef..d08be55d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ # $Id$ +2008-04-01 + * Fixed segfault when configuration doesn't contain TEXT block (thanks + Pippijn). + 2008-03-31 * Conky 1.5.1 released. * Added --enable-testing configure option to use insane compiler flags. diff --git a/src/conky.c b/src/conky.c index c2223dd1..7612d176 100644 --- a/src/conky.c +++ b/src/conky.c @@ -8398,6 +8398,9 @@ static void load_config_file(const char *f) } } fclose(fp); + if (strlen(text) < 1) { + CRIT_ERR("no text supplied in configuration; exiting"); + } text_lines = line + 1; return; } @@ -8436,6 +8439,9 @@ static void load_config_file(const char *f) // default to update_interval info.music_player_interval = update_interval; } + if (!text) { // didn't supply any text + CRIT_ERR("missing text block in configuration; exiting"); + } } /* : means that character before that takes an argument */