[PATCH RFC 1/6] purgatory: Fix memcmp for src address increment

Pratyush Anand panand at redhat.com
Thu Apr 16 09:47:24 PDT 2015


src addresses are not being incremented, so only first byte is compared
instead of first len bytes.

Signed-off-by: Pratyush Anand <panand at redhat.com>
---
 purgatory/string.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/purgatory/string.c b/purgatory/string.c
index 4f35613ef751..f06c460b08f8 100644
--- a/purgatory/string.c
+++ b/purgatory/string.c
@@ -46,6 +46,8 @@ int memcmp(void *src1, void *src2, size_t len)
 		if (*s1 != *s2) {
 			return *s2 - *s1;
 		}
+		s1++;
+		s2++;
 	}
 	return 0;
 	
-- 
2.1.0




More information about the kexec mailing list