From 15dbadf38992aa09364f0dd06a71a51b99b6e800 Mon Sep 17 00:00:00 2001 From: Dariusz Gadomski Date: Thu, 2 Oct 2014 14:10:39 +0200 Subject: [PATCH] printing: Properly initialize auth_info in gtkprintbackend.c auth_info should be a NULL-terminated array as it is used in e.g. g_strdupv invocations iterating over its elements until a NULL element is encountered. https://bugzilla.gnome.org/show_bug.cgi?id=737777 --- gtk/gtkprintbackend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkprintbackend.c b/gtk/gtkprintbackend.c index 31a181bddc..3dc40379ef 100644 --- a/gtk/gtkprintbackend.c +++ b/gtk/gtkprintbackend.c @@ -756,7 +756,7 @@ request_password (GtkPrintBackend *backend, priv->auth_info_required = g_strdupv (ai_required); length = g_strv_length (ai_required); - priv->auth_info = g_new0 (gchar *, length); + priv->auth_info = g_new0 (gchar *, length + 1); priv->store_auth_info = FALSE; dialog = gtk_dialog_new_with_buttons ( _("Authentication"), NULL, GTK_DIALOG_MODAL,