Skip to content
  • Jasper St. Pierre's avatar
    gnome-rr-config: Make sure to copy over vendor/product/serial · 7fdf9210
    Jasper St. Pierre authored
    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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742569
    7fdf9210