Commit 030bd0a7 by Ian Lance Taylor

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. Close #40
parent b3b57f9e
...@@ -903,6 +903,7 @@ macho_add_dsym (struct backtrace_state *state, const char *filename, ...@@ -903,6 +903,7 @@ macho_add_dsym (struct backtrace_state *state, const char *filename,
dsymsuffixdirlen = strlen (dsymsuffixdir); dsymsuffixdirlen = strlen (dsymsuffixdir);
dsymlen = (dirnamelen dsymlen = (dirnamelen
+ 1
+ basenamelen + basenamelen
+ dsymsuffixdirlen + dsymsuffixdirlen
+ basenamelen + basenamelen
...@@ -925,7 +926,7 @@ macho_add_dsym (struct backtrace_state *state, const char *filename, ...@@ -925,7 +926,7 @@ macho_add_dsym (struct backtrace_state *state, const char *filename,
if (diralc != NULL) if (diralc != NULL)
{ {
backtrace_free (state, diralc, dirnamelen, error_callback, data); backtrace_free (state, diralc, dirnamelen + 1, error_callback, data);
diralc = NULL; diralc = NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment