Skip to content

Commit

Permalink
dbghelp: Avoid strcpy_s() to lower CRT requirements
Browse files Browse the repository at this point in the history
Useful when building with MinGW, which targets msvcrt.dll.

Co-authored-by: Stefano Moioli <smxdev4@gmail.com>
  • Loading branch information
oleavr and smx-smx committed Nov 15, 2023
1 parent 4adadd9 commit b15f748
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gum/backend-dbghelp/gumsymbolutil-dbghelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ gum_symbol_details_from_address (gpointer address,

GetModuleBaseNameA (GetCurrentProcess (), mod, details->module_name,
sizeof (details->module_name) - 1);
strcpy_s (details->symbol_name, sizeof (details->symbol_name),
si.sym_info.Name);
g_strlcpy (details->symbol_name, si.sym_info.Name,
sizeof (details->symbol_name));
}

has_file_info = dbghelp->SymGetLineFromAddr64 (GetCurrentProcess (),
GPOINTER_TO_SIZE (address), &displacement_dw, &li);
if (has_file_info)
{
strcpy_s (details->file_name, sizeof (details->file_name), li.FileName);
g_strlcpy (details->file_name, li.FileName, sizeof (details->file_name));
details->line_number = li.LineNumber;
details->column = displacement_dw;
}
Expand Down

0 comments on commit b15f748

Please sign in to comment.