From f1c7390bdf1094efd1d9c904f0a73e4c20207d4e Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 22 Jun 2018 10:42:51 +0100 Subject: [PATCH] Fix scoping bug computing name for debuginfo file --- annocheck/annocheck.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/annocheck/annocheck.c b/annocheck/annocheck.c index bec6079..b6b5fce 100644 --- a/annocheck/annocheck.c +++ b/annocheck/annocheck.c @@ -552,11 +552,12 @@ follow_debuglink (eu_checksec_data * data, Dwarf * dwarf) const char * prefix = "/usr/lib/debug/.build-id/"; const char * suffix = ".debug"; - char * debugfile = xmalloc (strlen (prefix) - + build_id_len * 2 - + strlen (suffix) + 2); - char * n = debugfile; + char * n; unsigned char * d = (unsigned char *) build_id_ptr; + + n = debugfile = xmalloc (strlen (prefix) + + build_id_len * 2 + + strlen (suffix) + 2); n += sprintf (n, "%s%02x/", prefix, *d++); build_id_len --; -- 2.43.5