From: Ian Lance Taylor Date: Tue, 8 Sep 2020 21:50:32 +0000 (-0700) Subject: libbacktrace: correct memory lengths in Mach-O dsym support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8a7a97b4e62195f9f538bed37177af171e75b8b;p=gcc.git libbacktrace: correct memory lengths in Mach-O dsym support * macho.c (macho_add_dsym): Make space for '/' in dsym. Use correct length when freeing diralc. --- diff --git a/libbacktrace/macho.c b/libbacktrace/macho.c index 20dd3262d58..241d54b5e5e 100644 --- a/libbacktrace/macho.c +++ b/libbacktrace/macho.c @@ -903,6 +903,7 @@ macho_add_dsym (struct backtrace_state *state, const char *filename, dsymsuffixdirlen = strlen (dsymsuffixdir); dsymlen = (dirnamelen + + 1 + basenamelen + dsymsuffixdirlen + basenamelen @@ -925,7 +926,7 @@ macho_add_dsym (struct backtrace_state *state, const char *filename, if (diralc != NULL) { - backtrace_free (state, diralc, dirnamelen, error_callback, data); + backtrace_free (state, diralc, dirnamelen + 1, error_callback, data); diralc = NULL; }