Skip to content

Commit 030bd0a

Browse files
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
1 parent b3b57f9 commit 030bd0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

macho.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,7 @@ macho_add_dsym (struct backtrace_state *state, const char *filename,
903903
dsymsuffixdirlen = strlen (dsymsuffixdir);
904904

905905
dsymlen = (dirnamelen
906+
+ 1
906907
+ basenamelen
907908
+ dsymsuffixdirlen
908909
+ basenamelen
@@ -925,7 +926,7 @@ macho_add_dsym (struct backtrace_state *state, const char *filename,
925926

926927
if (diralc != NULL)
927928
{
928-
backtrace_free (state, diralc, dirnamelen, error_callback, data);
929+
backtrace_free (state, diralc, dirnamelen + 1, error_callback, data);
929930
diralc = NULL;
930931
}
931932

0 commit comments

Comments
 (0)