diff options
author | Gergo Huszty <huszty.gergo@digitaltrip.hu> | 2017-02-06 13:43:39 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-02-07 06:19:20 +0000 |
commit | d1d627afa2166f6a05b24cd2718839a5073362f9 (patch) | |
tree | 3abfe928c9f18cc5ec0127734012304e79354882 /community/minidlna/10-minidlna-nfo.patch | |
parent | 7d6603afecaac20b9cda0eb62a68bcd89d4ab656 (diff) | |
download | aports-d1d627afa2166f6a05b24cd2718839a5073362f9.tar.bz2 aports-d1d627afa2166f6a05b24cd2718839a5073362f9.tar.xz |
community/minidlna: out of stack fix reworked
As suggested, stack size is increased instead of moving nfo file
buffer to heap.
Diffstat (limited to 'community/minidlna/10-minidlna-nfo.patch')
-rw-r--r-- | community/minidlna/10-minidlna-nfo.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/community/minidlna/10-minidlna-nfo.patch b/community/minidlna/10-minidlna-nfo.patch new file mode 100644 index 0000000000..80fdab165d --- /dev/null +++ b/community/minidlna/10-minidlna-nfo.patch @@ -0,0 +1,32 @@ +--- a/metadata.c ++++ b/metadata.c +@@ -676,6 +676,7 @@ + + memset(&m, '\0', sizeof(m)); + memset(&video, '\0', sizeof(video)); ++ memset(nfo, '\0', sizeof(nfo)); + + //DEBUG DPRINTF(E_DEBUG, L_METADATA, "Parsing video %s...\n", name); + if ( stat(path, &file) != 0 ) +--- a/minidlna.c ++++ b/minidlna.c +@@ -1049,8 +1049,17 @@ + if (!sqlite3_threadsafe() || sqlite3_libversion_number() < 3005001) + DPRINTF(E_ERROR, L_GENERAL, "SQLite library is not threadsafe! " + "Inotify will be disabled.\n"); +- else if (pthread_create(&inotify_thread, NULL, start_inotify, NULL) != 0) +- DPRINTF(E_FATAL, L_GENERAL, "ERROR: pthread_create() failed for start_inotify. EXITING\n"); ++ else ++ { ++ pthread_attr_t attr, *attrptr = NULL; ++ if ((pthread_attr_init(&attr) == 0) && (pthread_attr_setstacksize(&attr, 192 * 1024) == 0)) ++ attrptr = &attr; ++ else ++ DPRINTF(E_ERROR, L_GENERAL, "Failed to set inotify thread stack size," ++ "continuing with the default.\n"); ++ if (pthread_create(&inotify_thread, attrptr, start_inotify, NULL) != 0) ++ DPRINTF(E_FATAL, L_GENERAL, "ERROR: pthread_create() failed for start_inotify. EXITING\n"); ++ } + } + #endif + smonitor = OpenAndConfMonitorSocket(); |