From a8a7a97b4e62195f9f538bed37177af171e75b8b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 8 Sep 2020 14:50:32 -0700 Subject: [PATCH] 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. --- libbacktrace/macho.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.30.2