Abort if prefs structure is NULL when editing outside the current

2001-06-21  Bradford Hovinen  <hovinen@ximian.com>

	* capplets/new-*/main.c (main): Abort if prefs structure is NULL
	when editing outside the current location. Fixes crash when bad
	XML data are supplied.
This commit is contained in:
Bradford Hovinen 2001-06-21 14:48:09 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 93e004a93f
commit c894d8e52b
7 changed files with 10 additions and 0 deletions

View file

@ -1,5 +1,9 @@
2001-06-21 Bradford Hovinen <hovinen@ximian.com> 2001-06-21 Bradford Hovinen <hovinen@ximian.com>
* capplets/new-*/main.c (main): Abort if prefs structure is NULL
when editing outside the current location. Fixes crash when bad
XML data are supplied.
* capplets/new-*/main.c (do_set_xml): Fix to use correct * capplets/new-*/main.c (do_set_xml): Fix to use correct
termination condition and g_string API termination condition and g_string API

View file

@ -280,6 +280,7 @@ main (int argc, char **argv)
{ {
outside_location = TRUE; outside_location = TRUE;
do_set_xml (FALSE); do_set_xml (FALSE);
if (prefs == NULL) return -1;
preferences_freeze (prefs); preferences_freeze (prefs);
} else { } else {
outside_location = FALSE; outside_location = FALSE;

View file

@ -269,6 +269,7 @@ main (int argc, char **argv)
{ {
outside_location = TRUE; outside_location = TRUE;
do_set_xml (FALSE); do_set_xml (FALSE);
if (prefs == NULL) return -1;
preferences_freeze (prefs); preferences_freeze (prefs);
} else { } else {
outside_location = FALSE; outside_location = FALSE;

View file

@ -265,6 +265,7 @@ main (int argc, char **argv)
{ {
outside_location = TRUE; outside_location = TRUE;
do_set_xml (FALSE); do_set_xml (FALSE);
if (prefs == NULL) return -1;
preferences_freeze (prefs); preferences_freeze (prefs);
} else { } else {
outside_location = FALSE; outside_location = FALSE;

View file

@ -384,6 +384,7 @@ main (int argc, char **argv)
{ {
outside_location = TRUE; outside_location = TRUE;
do_set_xml (FALSE); do_set_xml (FALSE);
if (prefs == NULL) return -1;
prefs->frozen++; prefs->frozen++;
} else { } else {
outside_location = FALSE; outside_location = FALSE;

View file

@ -267,6 +267,7 @@ main (int argc, char **argv)
{ {
outside_location = TRUE; outside_location = TRUE;
do_set_xml (FALSE); do_set_xml (FALSE);
if (prefs == NULL) return -1;
preferences_freeze (prefs); preferences_freeze (prefs);
} else { } else {
outside_location = FALSE; outside_location = FALSE;

View file

@ -256,6 +256,7 @@ main (int argc, char **argv)
{ {
outside_location = TRUE; outside_location = TRUE;
do_set_xml (FALSE); do_set_xml (FALSE);
if (prefs == NULL) return -1;
preferences_freeze (prefs); preferences_freeze (prefs);
} else { } else {
outside_location = FALSE; outside_location = FALSE;