mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-18 15:54:25 +00:00
perf build-id: Change sprintf functions to snprintf
Pass in a size argument rather than implying all build id strings must be SBUILD_ID_SIZE. Signed-off-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20250724163302.596743-4-irogers@google.com [ fixed some build errors ] Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
@@ -780,14 +780,13 @@ static void set_sym_in_dict(PyObject *dict, struct addr_location *al,
|
||||
const char *sym_field, const char *symoff_field,
|
||||
const char *map_pgoff)
|
||||
{
|
||||
char sbuild_id[SBUILD_ID_SIZE];
|
||||
|
||||
if (al->map) {
|
||||
char sbuild_id[SBUILD_ID_SIZE];
|
||||
struct dso *dso = map__dso(al->map);
|
||||
|
||||
pydict_set_item_string_decref(dict, dso_field,
|
||||
_PyUnicode_FromString(dso__name(dso)));
|
||||
build_id__sprintf(dso__bid(dso), sbuild_id);
|
||||
build_id__snprintf(dso__bid(dso), sbuild_id, sizeof(sbuild_id));
|
||||
pydict_set_item_string_decref(dict, dso_bid_field,
|
||||
_PyUnicode_FromString(sbuild_id));
|
||||
pydict_set_item_string_decref(dict, dso_map_start,
|
||||
@@ -1238,7 +1237,7 @@ static int python_export_dso(struct db_export *dbe, struct dso *dso,
|
||||
char sbuild_id[SBUILD_ID_SIZE];
|
||||
PyObject *t;
|
||||
|
||||
build_id__sprintf(dso__bid(dso), sbuild_id);
|
||||
build_id__snprintf(dso__bid(dso), sbuild_id, sizeof(sbuild_id));
|
||||
|
||||
t = tuple_new(5);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user