]> git.sesse.net Git - vlc/commit
config_PutPsz: fix potential use-after-free
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 29 May 2010 15:25:36 +0000 (18:25 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 29 May 2010 15:29:16 +0000 (18:29 +0300)
commit6b35f6ff09419006d8af86cfb507fc644669a118
tree32d0c5858e867ecd0001aafd7c2e4b21173ef481
parent2f5357149a3c7597de173884f85a87fefe24064e
config_PutPsz: fix potential use-after-free

The new config value is duplicated, and the copy is stored to the
configuration. After the configuration R/W lock is released, we have no
warranty that another thread does not change the same configuration
item, and free our own copy. Admittedly, this is very unlikely.

Instead, we can simply pass the original string from the caller to the
callback - that one must remain valid through the config_PutPsz()
function call by definition.
src/config/core.c