update: fixed stack corruption due to pthread_join() call
pthread_join() expects a "pointer to a pointer" parameter, but it got a "pointer to an enum". On AMD64, an enum is smaller than a pointer, leading to a buffer overflow.
This commit is contained in:
parent
b4f1b20fd9
commit
69e34f11f5
@ -451,6 +451,7 @@ int directory_update_init(char *path)
|
|||||||
|
|
||||||
void reap_update_task(void)
|
void reap_update_task(void)
|
||||||
{
|
{
|
||||||
|
void *thread_return;
|
||||||
enum update_return ret;
|
enum update_return ret;
|
||||||
|
|
||||||
assert(pthread_equal(pthread_self(), main_task));
|
assert(pthread_equal(pthread_self(), main_task));
|
||||||
@ -467,8 +468,9 @@ void reap_update_task(void)
|
|||||||
|
|
||||||
if (progress != UPDATE_PROGRESS_DONE)
|
if (progress != UPDATE_PROGRESS_DONE)
|
||||||
return;
|
return;
|
||||||
if (pthread_join(update_thr, (void **)&ret))
|
if (pthread_join(update_thr, &thread_return))
|
||||||
FATAL("error joining update thread: %s\n", strerror(errno));
|
FATAL("error joining update thread: %s\n", strerror(errno));
|
||||||
|
ret = (enum update_return)(size_t)thread_return;
|
||||||
if (ret == UPDATE_RETURN_UPDATED)
|
if (ret == UPDATE_RETURN_UPDATED)
|
||||||
playlistVersionChange();
|
playlistVersionChange();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user