After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 646250 - crash if background xml data are invalid
crash if background xml data are invalid
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Background
git master
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-30 16:55 UTC by Frederic Crozat
Modified: 2011-03-31 12:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
background: Don't assert() for typos in XML files (823 bytes, patch)
2011-03-30 17:36 UTC, Bastien Nocera
committed Details | Review

Description Frederic Crozat 2011-03-30 16:55:13 UTC
We noticed a crash in background panel if one of the xml background file contains incorrect enumeration data (typo in one of our files) :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
<wallpapers>
  <wallpaper deleted="false">
    <name>Default Background</name>
    <filename>/usr/share/themes/Adwaita/backgrounds/stripes.jpg</filename>
    <options>zoom</options>
    <shade_type>veritcal-gradient</shade_type>
    <pcolor>#3465a4</pcolor>
  </wallpaper>
</wallpapers>

and background panel will crash :

$ gnome-control-center background
 
(gnome-control-center:24250): background-cc-panel-WARNING **: Unhandled value 'veritcal-gradient' for enum 'GDesktopBackgroundShading'
**
background-cc-panel:ERROR:cc-background-xml.c:109:enum_string_to_value: code should not be reached
Aborted
Comment 1 Bastien Nocera 2011-03-30 17:22:46 UTC
Well, it doesn't crash, it aborts.

I agree that it shouldn't abort though. I'll fix this post-3.0.
Comment 2 Bastien Nocera 2011-03-30 17:36:39 UTC
Created attachment 184725 [details] [review]
background: Don't assert() for typos in XML files
Comment 3 Bastien Nocera 2011-03-31 12:08:58 UTC
Attachment 184725 [details] pushed as e46c326 - background: Don't assert() for typos in XML files