From 538dbe4e916c670aa3f696c318aaec4664770502 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sat, 7 Jun 2008 12:34:07 +0000 Subject: [PATCH] Bugfix: DEV_NAME tried to read uninitialised mem git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1139 7f574dfc-610e-0410-a909-a81674777703 --- src/conky.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conky.c b/src/conky.c index b5fad4bc..382c8d7a 100644 --- a/src/conky.c +++ b/src/conky.c @@ -2329,7 +2329,8 @@ void scan_mixer_bar(const char *arg, int *a, int *w, int *h) } /* strip a leading /dev/ if any */ -#define DEV_NAME(x) strncmp(x, "/dev/", 5) ? x : x + 5 +#define DEV_NAME(x) x != NULL && strlen(x) > 5 && strncmp(x, "/dev/", 5) == 0 \ + ? x + 5 : x /* construct_text_object() creates a new text_object */ static struct text_object *construct_text_object(const char *s,