Blob Blame History Raw
From 710a9445777793e49160587882860cbb7b43e311 Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Mon, 16 May 2016 15:27:35 +0100
Subject: [PATCH] Make pk_console_get_prompt() big endian safe

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1255079
---
 lib/packagekit-glib2/pk-console-shared.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/packagekit-glib2/pk-console-shared.c b/lib/packagekit-glib2/pk-console-shared.c
index 66cb372..d61f3a1 100644
--- a/lib/packagekit-glib2/pk-console-shared.c
+++ b/lib/packagekit-glib2/pk-console-shared.c
@@ -116,7 +116,8 @@ pk_readline_unbuffered (const gchar *prompt)
 			g_warning ("Got unexpected EOF.");
 			break;
 		} else {
-			g_string_append_len (str, (const gchar *) &c, 1);
+			gchar c_safe = (gchar) c;
+			g_string_append_len (str, (const gchar *) &c_safe, 1);
 		}
 	}
 	tcsetattr (fileno (tty), TCSAFLUSH, &ots);
-- 
2.7.4