[gtk+/gtk-3-14] Remove overzealous validity check for secrets
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-14] Remove overzealous validity check for secrets
- Date: Thu, 11 Dec 2014 14:30:11 +0000 (UTC)
commit 7d066258f39fb51f20e57a379b265708c2303d57
Author: Andre Heinecke <aheinecke intevation de>
Date: Mon Nov 24 10:59:32 2014 +0100
Remove overzealous validity check for secrets
We directly get the length of the secret from the g_variant
and use it in a following g_strndup which ensures that the
resulting string is terminated.
This fixes reading secrets which were stored by system-config-printer.
https://bugzilla.gnome.org/show_bug.cgi?id=740612
modules/printbackends/cups/gtkcupssecretsutils.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/modules/printbackends/cups/gtkcupssecretsutils.c
b/modules/printbackends/cups/gtkcupssecretsutils.c
index 895e4bb..7c5f374 100644
--- a/modules/printbackends/cups/gtkcupssecretsutils.c
+++ b/modules/printbackends/cups/gtkcupssecretsutils.c
@@ -200,10 +200,9 @@ get_secret_cb (GObject *source_object,
g_variant_unref (secret);
- if (ba_passwd == NULL || strlen (ba_passwd) > len + 1)
+ if (ba_passwd == NULL)
{
- /* No secret or the secret is not a zero terminated value */
- GTK_NOTE (PRINTING, g_print ("Invalid secret.\n"));
+ GTK_NOTE (PRINTING, g_print ("Invalid / no secret found.\n"));
g_variant_unref (s_value);
goto fail;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]