Commit 69e34f11 authored by Max Kellermann's avatar Max Kellermann

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.
parent b4f1b20f
......@@ -451,6 +451,7 @@ int directory_update_init(char *path)
void reap_update_task(void)
{
void *thread_return;
enum update_return ret;
assert(pthread_equal(pthread_self(), main_task));
......@@ -467,8 +468,9 @@ void reap_update_task(void)
if (progress != UPDATE_PROGRESS_DONE)
return;
if (pthread_join(update_thr, (void **)&ret))
if (pthread_join(update_thr, &thread_return))
FATAL("error joining update thread: %s\n", strerror(errno));
ret = (enum update_return)(size_t)thread_return;
if (ret == UPDATE_RETURN_UPDATED)
playlistVersionChange();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment