mirror of
https://github.com/ianlancetaylor/libbacktrace.git
synced 2026-03-21 09:49:06 +08:00
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
This commit is contained in:
3
macho.c
3
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user