From: Nick Clifton Date: Fri, 22 Jun 2018 09:42:51 +0000 (+0100) Subject: Fix scoping bug computing name for debuginfo file X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=f1c7390bdf1094efd1d9c904f0a73e4c20207d4e;p=annobin.git Fix scoping bug computing name for debuginfo file --- 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 --;