summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-04-13 06:37:03 +0000
committerworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-04-13 06:37:03 +0000
commitde92d404fd89859238fcff270318695132c247bc (patch)
treef53fc6fac18ffd500bc46b92054a870933c5cd8a
parent3dc9b33fb7a0acf44c5bece2824b7cbb31658f17 (diff)
downloadvdr-plugin-muggle-de92d404fd89859238fcff270318695132c247bc.tar.gz
vdr-plugin-muggle-de92d404fd89859238fcff270318695132c247bc.tar.bz2
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
-rw-r--r--HISTORY2
-rw-r--r--muggle.c12
-rw-r--r--mugglei.c2
-rw-r--r--po/muggle.pot2
-rw-r--r--vdr_setup.c1
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: <vdr-muggle-develop@sourceforge.net>\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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ) );