Public bug reported:

On Ubuntu 22.04, gnome-control-center (41.7) crashes with a segmentation fault 
if $XDG_CURRENT_DESKTOP is not set, upon entering the Sound menu.
This is due to the passing of a NULL pointer into strstr which results in 
undefined behavior.

For the user it gets worse, as entering Sound instantly crashes the
application and subsequent launches will keep starting in Sound and just
keep crashing. The application is then not usable, and it's not directly
clear how to reset it as to not start in Sound.

In this case, it is partly my fault since I don't use a GNOME desktop
environment resulting in this env variable not being set.

panels/sound/cc-sound-panel.c:305
    if (strstr (g_getenv("XDG_CURRENT_DESKTOP"), "ubuntu") != NULL) {

Which seem to originate from
    debian/patches/ubuntu/sound-Allow-volume-to-be-set-above-100.patch
    -> gnome-control-center_41.7-0ubuntu0.22.04.6.debian.tar.xz

Fixed by adding `alias XDG_CURRENT_DESKTOP=test` in .bashrc.

System:
    Sway (Ubuntu's default DE is also installed)
    Ubuntu 22.04 (updated 2023-02-28)
    Linux 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 x86_64 
x86_64 x86_64 GNU/Linux

** Affects: gnome-control-center (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: crash patch

** Description changed:

  On Ubuntu 22.04, gnome-control-center (41.7) crashes with a segmentation 
fault if $XDG_CURRENT_DESKTOP is not set, upon entering the Sound menu.
  This is due to the passing of a NULL pointer into strstr which results in 
undefined behavior.
  
  For the user it gets worse, as entering Sound instantly crashes the
  application and subsequent launches will keep starting in Sound and just
  keep crashing. The application is then not usable, and it's not directly
  clear how to reset it as to not start in Sound.
  
  In this case, it is partly my fault since I don't use a GNOME desktop
  environment resulting in this env variable not being set.
  
- **panels/sound/cc-sound-panel.c:305** \
- `if (strstr (g_getenv("XDG_CURRENT_DESKTOP"), "ubuntu") != NULL) {`
+ panels/sound/cc-sound-panel.c:305
+ if (strstr (g_getenv("XDG_CURRENT_DESKTOP"), "ubuntu") != NULL) {
  
  Which seem to originate from debian/patches/ubuntu/sound-Allow-volume-
  to-be-set-above-100.patch from gnome-control-
  center_41.7-0ubuntu0.22.04.6.debian.tar.xz
  
  Fixed by adding `alias XDG_CURRENT_DESKTOP=test` in .bashrc.
  
  
- ```
+ 
  System:
-     Sway (Ubuntu's default DE is also installed)
-     Ubuntu 22.04 (updated 2023-02-28)
-     Linux 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 
x86_64 x86_64 x86_64 GNU/Linux
- ```
+     Sway (Ubuntu's default DE is also installed)
+     Ubuntu 22.04 (updated 2023-02-28)
+     Linux 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 
x86_64 x86_64 x86_64 GNU/Linux

** Description changed:

  On Ubuntu 22.04, gnome-control-center (41.7) crashes with a segmentation 
fault if $XDG_CURRENT_DESKTOP is not set, upon entering the Sound menu.
  This is due to the passing of a NULL pointer into strstr which results in 
undefined behavior.
  
  For the user it gets worse, as entering Sound instantly crashes the
  application and subsequent launches will keep starting in Sound and just
  keep crashing. The application is then not usable, and it's not directly
  clear how to reset it as to not start in Sound.
  
  In this case, it is partly my fault since I don't use a GNOME desktop
  environment resulting in this env variable not being set.
  
  panels/sound/cc-sound-panel.c:305
- if (strstr (g_getenv("XDG_CURRENT_DESKTOP"), "ubuntu") != NULL) {
+     if (strstr (g_getenv("XDG_CURRENT_DESKTOP"), "ubuntu") != NULL) {
  
- Which seem to originate from debian/patches/ubuntu/sound-Allow-volume-
- to-be-set-above-100.patch from gnome-control-
- center_41.7-0ubuntu0.22.04.6.debian.tar.xz
+ Which seem to originate from
+     debian/patches/ubuntu/sound-Allow-volume-to-be-set-above-100.patch
+     -> gnome-control-center_41.7-0ubuntu0.22.04.6.debian.tar.xz
  
  Fixed by adding `alias XDG_CURRENT_DESKTOP=test` in .bashrc.
- 
- 
  
  System:
      Sway (Ubuntu's default DE is also installed)
      Ubuntu 22.04 (updated 2023-02-28)
      Linux 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 
x86_64 x86_64 x86_64 GNU/Linux

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gnome-control-center in Ubuntu.
https://bugs.launchpad.net/bugs/2008770

Title:
  Sound: seg fault if env variable not set (v41.7)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/2008770/+subscriptions


-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to