From de92d404fd89859238fcff270318695132c247bc Mon Sep 17 00:00:00 2001 From: woro Date: Sun, 13 Apr 2008 06:37:03 +0000 Subject: fix segfault if the cache directory has a long path git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@1180 e10066b5-e1e2-0310-b819-94efdf66514b --- HISTORY | 2 ++ muggle.c | 12 +++++++----- mugglei.c | 2 +- po/muggle.pot | 2 +- vdr_setup.c | 1 + 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/HISTORY b/HISTORY index 4f6dded..67112b3 100644 --- a/HISTORY +++ b/HISTORY @@ -330,3 +330,5 @@ XXXXXXXXXX: Version 0.0.8-ALPHA - if lyrics are loaded from internet and no local lyrics exist yet, they are now saved automatically - display small cover: Appeared at left border instead at the right side +- sqlite3: muggle segfaulted in special situations +- fix segfault if the cache directory has a long path diff --git a/muggle.c b/muggle.c index 7034147..6fdb4a8 100644 --- a/muggle.c +++ b/muggle.c @@ -108,11 +108,13 @@ bool mgMuggle::SetupParse (const char *Name, const char *Value) { the_setup.DeleteStaleReferences = atoi (Value); else if (!strcasecmp (Name, "ImageShowDuration")) the_setup.ImageShowDuration = atoi (Value); - else if (!strcasecmp (Name, "ImageCacheDir")) // old version - strn0cpy (the_setup.CacheDir, Value, MAX_PATH); - else if (!strcasecmp (Name, "CacheDir")) - strn0cpy (the_setup.CacheDir, Value, MAX_PATH); - else if (!strcasecmp (Name, "UseStillPicture")) + else if (!strcasecmp (Name, "ImageCacheDir")) { // old version + free(the_setup.CacheDir); + the_setup.CacheDir=strdup(Value); + } else if (!strcasecmp (Name, "CacheDir")) { + free(the_setup.CacheDir); + the_setup.CacheDir=strdup(Value); + } else if (!strcasecmp (Name, "UseStillPicture")) the_setup.UseDeviceStillPicture = atoi (Value); else if (!strcasecmp(Name, "Jumptime")) the_setup.Jumptime = atoi(Value); diff --git a/mugglei.c b/mugglei.c index 4962834..6aded67 100644 --- a/mugglei.c +++ b/mugglei.c @@ -31,7 +31,7 @@ using namespace std; -int SysLogLevel = 1; +int SysLogLevel = 9; void showmessage(int duration,const char *msg,...) { va_list ap; diff --git a/po/muggle.pot b/po/muggle.pot index 7eab8d2..f5150a6 100644 --- a/po/muggle.pot +++ b/po/muggle.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-04-11 22:05+0200\n" +"POT-Creation-Date: 2008-04-13 08:03+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/vdr_setup.c b/vdr_setup.c index 4e413d0..e760ed2 100644 --- a/vdr_setup.c +++ b/vdr_setup.c @@ -67,6 +67,7 @@ mgMenuSetup::mgMenuSetup () { Add (new cMenuEditIntItem (tr ("Image show duration (secs)"), &the_setup.ImageShowDuration, 1, 100)); + the_setup.CacheDir=(char*)realloc(the_setup.CacheDir,MAX_PATH+1); Add (new cMenuEditStrItem (tr ("Cache directory"), the_setup.CacheDir, MAX_PATH, chars_allowed ) ); -- cgit v1.2.3