diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c index 366fd2398c..e9a30a1ce3 100644 --- a/gtk/gtkcheckbutton.c +++ b/gtk/gtkcheckbutton.c @@ -913,6 +913,8 @@ gtk_check_button_set_label (GtkCheckButton *self, * Setting the group of a check button also changes the css name of the * indicator widget's CSS node to 'radio'. * + * Setting up groups in a cycle leads to undefined behavior. + * * Note that the same effect can be achieved via the [interface@Gtk.Actionable] * API, by using the same action with parameter type and state type 's' * for all buttons in the group, and giving each button its own target @@ -926,6 +928,7 @@ gtk_check_button_set_group (GtkCheckButton *self, GtkCheckButtonPrivate *group_priv = gtk_check_button_get_instance_private (group); g_return_if_fail (GTK_IS_CHECK_BUTTON (self)); + g_return_if_fail (self != group); if (!group) { diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c index 86dfcafdfb..94fccffd82 100644 --- a/gtk/gtkcssshadowvalue.c +++ b/gtk/gtkcssshadowvalue.c @@ -494,14 +494,14 @@ gtk_css_shadow_value_parse (GtkCssParser *parser, return gtk_css_shadow_value_new_none (); do { + if (n_shadows == MAX_SHADOWS) + { + gtk_css_parser_error_syntax (parser, "Not more than %d shadows supported", MAX_SHADOWS); + goto fail; + } if (gtk_css_shadow_value_parse_one (parser, box_shadow_mode, &shadows[n_shadows])) n_shadows++; - if (n_shadows > MAX_SHADOWS) - { - gtk_css_parser_error_syntax (parser, "Not more than 64 shadows supported"); - goto fail; - } } while (gtk_css_parser_try_token (parser, GTK_CSS_TOKEN_COMMA)); return gtk_css_shadow_value_new (shadows, n_shadows, FALSE); diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c index a8d4ff7763..bad631c022 100644 --- a/gtk/gtksizerequest.c +++ b/gtk/gtksizerequest.c @@ -698,6 +698,7 @@ gtk_distribute_natural_allocation (int extra_space, int i; g_return_val_if_fail (extra_space >= 0, 0); + g_return_val_if_fail (n_requested_sizes > 0, 0); spreading = g_newa (guint, n_requested_sizes); diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c index 6ae96fc8af..1e53a896c6 100644 --- a/gtk/gtktogglebutton.c +++ b/gtk/gtktogglebutton.c @@ -473,6 +473,8 @@ gtk_toggle_button_toggled (GtkToggleButton *toggle_button) * In a group of multiple toggle buttons, only one button can be active * at a time. * + * Setting up groups in a cycle leads to undefined behavior. + * * Note that the same effect can be achieved via the [interface@Gtk.Actionable] * API, by using the same action with parameter type and state type 's' * for all buttons in the group, and giving each button its own target @@ -486,6 +488,7 @@ gtk_toggle_button_set_group (GtkToggleButton *toggle_button, GtkToggleButtonPrivate *group_priv = gtk_toggle_button_get_instance_private (group); g_return_if_fail (GTK_IS_TOGGLE_BUTTON (toggle_button)); + g_return_if_fail (toggle_button != group); if (!group) { diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index c02dcd3a17..c542af00ba 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -2471,7 +2471,9 @@ gtk_tree_store_move (GtkTreeStore *tree_store, GNode *parent, *node, *a, *b, *tmp, *tmp_a, *tmp_b; int old_pos, new_pos, length, i, *order; GtkTreePath *path = NULL, *tmppath, *pos_path = NULL; - GtkTreeIter parent_iter, dst_a, dst_b; + GtkTreeIter parent_iter = { 0, }; + GtkTreeIter dst_a = { 0, }; + GtkTreeIter dst_b = { 0, }; int depth = 0; gboolean handle_b = TRUE; diff --git a/modules/printbackends/gtkprintbackendlpr.c b/modules/printbackends/gtkprintbackendlpr.c index 17ed4fbf3f..ea7770f5a9 100644 --- a/modules/printbackends/gtkprintbackendlpr.c +++ b/modules/printbackends/gtkprintbackendlpr.c @@ -103,7 +103,7 @@ char ** g_io_module_query (void) { char *eps[] = { - GTK_PRINT_BACKEND_EXTENSION_POINT_NAME, + (char *)GTK_PRINT_BACKEND_EXTENSION_POINT_NAME, NULL }; @@ -399,13 +399,12 @@ lpr_printer_get_options (GtkPrinter *printer, GtkPrinterOptionSet *set; GtkPrinterOption *option; const char *command; - char *n_up[] = {"1", "2", "4", "6", "9", "16" }; + const char *n_up[] = {"1", "2", "4", "6", "9", "16" }; set = gtk_printer_option_set_new (); option = gtk_printer_option_new ("gtk-n-up", _("Pages Per Sheet"), GTK_PRINTER_OPTION_TYPE_PICKONE); - gtk_printer_option_choices_from_array (option, G_N_ELEMENTS (n_up), - (char **)n_up, (char **)n_up); + gtk_printer_option_choices_from_array (option, G_N_ELEMENTS (n_up), n_up, n_up); gtk_printer_option_set (option, "1"); gtk_printer_option_set_add (set, option); g_object_unref (option); diff --git a/subprojects/gtk-doc.wrap b/subprojects/gtk-doc.wrap deleted file mode 100644 index 79ec37220a..0000000000 --- a/subprojects/gtk-doc.wrap +++ /dev/null @@ -1,5 +0,0 @@ -[wrap-git] -directory=gtk-doc -url=https://gitlab.gnome.org/GNOME/gtk-doc.git -revision=master -depth=1