Blame SOURCES/0185-Fix-security-issue-when-reading-username-and-passwor.patch

d41074
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a85e8e
From: Hector Marco-Gisbert <hecmargi@upv.es>
a85e8e
Date: Fri, 13 Nov 2015 16:21:09 +0100
d41074
Subject: [PATCH] Fix security issue when reading username and password
a85e8e
a85e8e
  This patch fixes two integer underflows at:
a85e8e
    * grub-core/lib/crypto.c
a85e8e
    * grub-core/normal/auth.c
a85e8e
a85e8e
Resolves: CVE-2015-8370
a85e8e
a85e8e
Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
a85e8e
Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
a85e8e
---
a85e8e
 grub-core/lib/crypto.c  | 2 +-
a85e8e
 grub-core/normal/auth.c | 2 +-
a85e8e
 2 files changed, 2 insertions(+), 2 deletions(-)
a85e8e
a85e8e
diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c
d41074
index 8e8426c4ab4..a23519cb3bd 100644
a85e8e
--- a/grub-core/lib/crypto.c
a85e8e
+++ b/grub-core/lib/crypto.c
a85e8e
@@ -456,7 +456,7 @@ grub_password_get (char buf[], unsigned buf_size)
a85e8e
 	  break;
a85e8e
 	}
a85e8e
 
a85e8e
-      if (key == '\b')
a85e8e
+      if (key == '\b' && cur_len)
a85e8e
 	{
a85e8e
 	  cur_len--;
a85e8e
 	  continue;
a85e8e
diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
d41074
index c6bd96e28ec..5782ec5a940 100644
a85e8e
--- a/grub-core/normal/auth.c
a85e8e
+++ b/grub-core/normal/auth.c
a85e8e
@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned buf_size)
a85e8e
 	  break;
a85e8e
 	}
a85e8e
 
a85e8e
-      if (key == '\b')
a85e8e
+      if (key == '\b' && cur_len)
a85e8e
 	{
a85e8e
 	  cur_len--;
a85e8e
 	  grub_printf ("\b");