GNOME Bugzilla – Bug 742569
gnome-rr-config: Make sure to copy over vendor/product/serial
Last modified: 2015-01-08 23:04:11 UTC
See patch. This caused crashes for us in the Display panel of gnome-control-center on ARM.
Created attachment 294073 [details] [review] gnome-rr-config: Make sure to copy over vendor/product/serial When GnomeRROutputInfo is normally created, we strdup the vendor/product/serial strings that we read from EDID. When it's finalized, we free them as well. When we copy the output info, we actually copy the raw struct, and then selectively strdup members that we care about. When the copy is freed, we then free the pointer that we dup'd from. When the original output info is freed, this leads to a double-free. Due to coincidences, on x86, this doesn't lead to a crash, but on ARM, the heap is completely corrupted. To prevent this, when we copy the output infos, strdup them from the original output as well. We really should clean this API up so that it's not so awfully RandR-y in style, since it's obvious that the APIs we have aren't great and really aren't what we need.
Review of attachment 294073 [details] [review]: Looks good. Could you simplify that code in a second patch, to remove the "if (old->priv->vendor)" constructs? g_strdup() can handle NULL just fine.
Attachment 294073 [details] pushed as 7fdf921 - gnome-rr-config: Make sure to copy over vendor/product/serial