Skip to content

Commit

Permalink
ref: convert last sprintf call to snprintf (#3077)
Browse files Browse the repository at this point in the history
  • Loading branch information
armcknight authored May 31, 2023
1 parent f587451 commit c78683b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Sources/SentryCrash/Recording/SentryCrashReport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit c78683b

Please sign in to comment.