mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 05:12:09 +00:00
gstmeta: intern registered impl string
Subsequent lookups in the hashtable are probably better done on memory we're confident is allocated to us :) It was easy to trigger invalid reads by calling gst_meta_register with dynamically allocated memory, freeing that memory, then calling gst_meta_get_info() Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/628>
This commit is contained in:
parent
f26a9ebafb
commit
3393b456e4
1 changed files with 2 additions and 1 deletions
|
@ -198,7 +198,8 @@ gst_meta_register (GType api, const gchar * impl, gsize size,
|
|||
g_type_name (api), size);
|
||||
|
||||
g_rw_lock_writer_lock (&lock);
|
||||
g_hash_table_insert (metainfo, (gpointer) impl, (gpointer) info);
|
||||
g_hash_table_insert (metainfo, (gpointer) g_intern_string (impl),
|
||||
(gpointer) info);
|
||||
g_rw_lock_writer_unlock (&lock);
|
||||
|
||||
return info;
|
||||
|
|
Loading…
Reference in a new issue