From c78683b1b3d2c0b86f068616fd84c40c09db266d Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 31 May 2023 14:33:20 -0800 Subject: [PATCH] ref: convert last sprintf call to snprintf (#3077) --- CHANGELOG.md | 1 + Sources/SentryCrash/Recording/SentryCrashReport.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6101151d66e..6ec8ba913ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Changed `Trace` serialized value of `sampled` from string to boolean (#3067) - Duplicated HTTP breadcrumbs (#3058) - Expose SentryPrivate and SentrySwiftUI schemes for cartahge clients that have `--no-use-binaries` option (#3071) +- Convert last remaining `sprintf` call to `snprintf` (#3077) ### Breaking Changes diff --git a/Sources/SentryCrash/Recording/SentryCrashReport.c b/Sources/SentryCrash/Recording/SentryCrashReport.c index 29e63088a8a..93963fa55db 100644 --- a/Sources/SentryCrash/Recording/SentryCrashReport.c +++ b/Sources/SentryCrash/Recording/SentryCrashReport.c @@ -917,7 +917,7 @@ writeNotableStackContents(const SentryCrashReportWriter *const writer, for (uintptr_t address = lowAddress; address < highAddress; address += sizeof(address)) { if (sentrycrashmem_copySafely( (void *)address, &contentsAsPointer, sizeof(contentsAsPointer))) { - sprintf(nameBuffer, "stack@%p", (void *)address); + snprintf(nameBuffer, sizeof(nameBuffer), "stack@%p", (void *)address); writeMemoryContentsIfNotable(writer, nameBuffer, contentsAsPointer); } }