Skip to content
Snippets Groups Projects
  1. Mar 29, 2025
  2. Mar 15, 2025
  3. Mar 03, 2025
  4. Jan 19, 2025
    • Joan Bruguera's avatar
      fix(gamma-wl): fix potential uninitialized read of gamma_size · 863538c8
      Joan Bruguera authored
      `wayland_set_temperature` assumes that after `wl_display_roundtrip`,
      some of the callbacks for `zwlr_gamma_control_v1_listener` will have
      been called to initialize `output->gamma_size`.
      
      However, this isn't necessarily true, for example if an output is
      plugged in right before `wl_display_roundtrip` is called, that output's
      `zwlr_gamma_control_v1_listener` won't have been initialized, thus it
      won't get a callback, and when `wl_display_roundtrip` returns,
      gammastep will read an uninitialized `gamma_size` (as reported by
      Valgrind), and potentially crash if it reads a non-zero value.
      
      I have also seen this uninitialized read happen in other scenarios, for
      example when unplugging an output or switching TTYs, sometimes wlroots
      will not call any gamma callbacks. But the one about plugging an output
      before `wl_display_roundtrip` is consistent (and gammastep's fault).
      
      Initialize `output->gamma_size` during creation to prevent this.
      863538c8
    • Joan Bruguera's avatar
      fix(gamma-wl): make outputs a linked list for pointer stability · 7b20d273
      Joan Bruguera authored
      Before this commit, the list of outputs was kept in a dynamic array
      that is resized using realloc when an output is added or removed.
      
      This is problematic because pointers to the elements of the dynamic
      array are passed to `zwlr_gamma_control_v1_add_listener` so that they
      become the `data` argument of the listener's callback. When an output
      is added/removed, the dynamic array may get relocated, thus pointers
      to other outputs become invalid/dangling, and gammastep may crash.
      
      This can be reproduced quite consistently by adding a `sleep` before
      the call to `wl_display_roundtrip` in `wayland_set_temperature`, and
      plugging or unplugging an output during the `sleep`.
      
      This commit fixes it by making `outputs` a wl_list, so outputs can be
      added or removed without invalidating pointers to other outputs.
      7b20d273
  5. Sep 12, 2022
  6. Sep 11, 2022
  7. Dec 23, 2021
  8. Jun 28, 2021
  9. Feb 20, 2021
  10. Jan 15, 2021
    • Cameron Nemo's avatar
    • Thiago Kenji Okada's avatar
      fix(indicator): escape error message in dialog · 88e2a78e
      Thiago Kenji Okada authored and Cameron Nemo's avatar Cameron Nemo committed
      The error message popup was showing empty with the following error
      message showing in the stderr:
      
      ```
      </i>' from markup due to error parsing markup: Error on line 2 char 45: “ ” is not a valid character following a “<” character; it may not begin an element name
      ```
      
      It happening because the error message sometimes contain either < or >
      characters, the XML markup was trying to interpret as a tag and failing.
      
      This commit fixes it by escaping the text to be XML safe.
      88e2a78e
    • Zsolt Donca's avatar
      fix(wlr): downgrade error condition to a warning · 0fbd6516
      Zsolt Donca authored and Cameron Nemo's avatar Cameron Nemo committed
      The affected code checks if there are outputs that support
      gamma adjustment, and in case there aren't, it used to log
      an error and exit. Since this condition appears to match
      when closing the lid, it makes sense to consider this as
      just a warning and continue.
      
      Closes #24
      0fbd6516
  11. Dec 31, 2020
  12. Dec 13, 2020
  13. Nov 15, 2020
  14. Oct 13, 2020
Loading