diff options
author | sfan5 <sfan5@live.de> | 2021-04-05 22:34:14 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2021-04-08 23:47:35 +0300 |
commit | 6479646f418c943a0488b4569709fb95ae318376 (patch) | |
tree | 0b2f4806dfe443edaab5f5f886a1a3424891ffd4 /player | |
parent | 9c120dedb3ca9524421d41e940a83fc973e6942a (diff) | |
download | mpv-6479646f418c943a0488b4569709fb95ae318376.tar.bz2 mpv-6479646f418c943a0488b4569709fb95ae318376.tar.xz |
player/scripting: fix use-after-free when loading script folders
Diffstat (limited to 'player')
-rw-r--r-- | player/scripting.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/player/scripting.c b/player/scripting.c index 24e2931539..3db879778c 100644 --- a/player/scripting.c +++ b/player/scripting.c @@ -174,9 +174,10 @@ static int64_t mp_load_script(struct MPContext *mpctx, const char *fname) }; talloc_free(tmp); + fname = NULL; // might have been freed so don't touch anymore if (!arg->client) { - MP_ERR(mpctx, "Failed to create client for script: %s\n", fname); + MP_ERR(mpctx, "Failed to create client for script: %s\n", arg->filename); talloc_free(arg); return -1; } @@ -185,7 +186,7 @@ static int64_t mp_load_script(struct MPContext *mpctx, const char *fname) arg->log = mp_client_get_log(arg->client); int64_t id = mpv_client_id(arg->client); - MP_DBG(arg, "Loading %s %s...\n", backend->name, fname); + MP_DBG(arg, "Loading %s %s...\n", backend->name, arg->filename); if (backend->no_thread) { run_script(arg); |