-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix several messages mistreated as format strings #114970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -257,7 +257,7 @@ bool _DbgBreakCheck( | |
| if (formattedMessages) | ||
| { | ||
| OutputDebugStringUtf8(formatBuffer); | ||
| minipal_log_print_error(formatBuffer); | ||
| minipal_log_print_error("%s", formatBuffer); | ||
| } | ||
| else | ||
| { | ||
|
|
@@ -489,7 +489,7 @@ void DECLSPEC_NORETURN __FreeBuildAssertFail(const char *szFile, int iLine, cons | |
| OutputDebugStringUtf8(buffer.GetUTF8()); | ||
|
|
||
| // Write out the error to the console | ||
| minipal_log_print_error(buffer.GetUTF8()); | ||
| minipal_log_print_error("%s", buffer.GetUTF8()); | ||
|
||
|
|
||
| // Log to the stress log. Note that we can't include the szExpr b/c that | ||
| // may not be a string literal (particularly for formatt-able asserts). | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -520,7 +520,7 @@ InteropMethodTableData *MethodTableBuilder::BuildInteropVTable(AllocMemTracker * | |||||
| message.AppendUTF8((LPCUTF8) qb.Ptr()); | ||||||
| message.AppendUTF8("\n"); | ||||||
|
|
||||||
| minipal_log_print_info(message.GetUTF8()); | ||||||
| minipal_log_print_info("%s", message.GetUTF8()); | ||||||
|
||||||
| minipal_log_print_info("%s", message.GetUTF8()); | |
| minipal_log_print_info(message.GetUTF8()); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2264,7 +2264,7 @@ static void DumpGCRefMap(const char *name, BYTE *address) | |
| } | ||
| buf.AppendUTF8("\n"); | ||
|
|
||
| minipal_log_print_info(buf.GetUTF8()); | ||
| minipal_log_print_info("%s", buf.GetUTF8()); | ||
|
||
| } | ||
| #endif | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing a format string explicitly ensures that the error message from formatBuffer is displayed correctly without format string errors.