Blame SOURCES/file-5.11-buildid.patch

435ea7
From 26f146f7dcf96f8f0a5b2f0503bdb4c46b74cf56 Mon Sep 17 00:00:00 2001
435ea7
From: Christos Zoulas <christos@zoulas.com>
435ea7
Date: Wed, 31 Oct 2012 17:03:41 +0000
435ea7
Subject: [PATCH] PR/208: Fix buildid format
435ea7
435ea7
---
435ea7
 src/readelf.c | 11 ++++++-----
435ea7
 1 file changed, 6 insertions(+), 5 deletions(-)
435ea7
435ea7
diff --git a/src/readelf.c b/src/readelf.c
435ea7
index deb6d31..158f789 100644
435ea7
--- a/src/readelf.c
435ea7
+++ b/src/readelf.c
435ea7
@@ -473,13 +473,14 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
435ea7
 
435ea7
 	if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 &&
435ea7
 	    xnh_type == NT_GNU_BUILD_ID && (descsz == 16 || descsz == 20)) {
435ea7
-	    uint32_t desc[5], i;
435ea7
-	    if (file_printf(ms, ", BuildID[%s]=0x", descsz == 16 ? "md5/uuid" :
435ea7
+	    uint8_t desc[20];
435ea7
+	    uint32_t i;
435ea7
+	    if (file_printf(ms, ", BuildID[%s]=", descsz == 16 ? "md5/uuid" :
435ea7
 		"sha1") == -1)
435ea7
 		    return size;
435ea7
 	    (void)memcpy(desc, &nbuf[doff], descsz);
435ea7
-	    for (i = 0; i < descsz >> 2; i++)
435ea7
-		if (file_printf(ms, "%.8x", desc[i]) == -1)
435ea7
+	    for (i = 0; i < descsz; i++)
435ea7
+		if (file_printf(ms, "%02x", desc[i]) == -1)
435ea7
 		    return size;
435ea7
 	    *flags |= FLAGS_DID_BUILD_ID;
435ea7
 	}