[vlc-devel] [PATCH] Udev SD: Try to find out the mount point for blu-ray discs.
Rémi Denis-Courmont
remi at remlab.net
Wed Feb 15 18:09:41 CET 2012
On Wed, 15 Feb 2012 20:18:40 +0400, Konstantin Pavlov
<thresh at videolan.org>
wrote:
> On Wed, Feb 15, 2012 at 04:39:02PM +0100, Rémi Denis-Courmont wrote:
>> >> > + while ((m = getmntent_r (mtab, &mbuf, buf, sizeof(buf)))
!=
>> >> NULL)
>> >> > + {
>> >> > + if( !strcmp (m->mnt_fsname, val)) val = m->mnt_dir;
>> >> > + }
>> >> > + endmntent (mtab);
>> >> > + }
>> >> > +
>> >> > return make_URI (val, scheme);
>> >>
>> >> This looks like use-after-release to me.
>> >
>> > Uhm, why?
>>
>> val = m->mnt_dir... I don't suppose the storage for that is still
valid.
>
> The attached patch doesnt re-use val.
We already went through this. It will fail if the disc is inserted _after_
the SD plugin starts. By the time udev fires the disc event, the file
system is obviously not mounted.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list