mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
Use a fixed-size buffer for log messages
libc++'s implementation of ostrstream seems to have incorrect range-checking and does some out-of-bounds reads and writes whenever a resize is needed, which results in crashes on 10.7 (but not 10.9 for unknown reasons).
This commit is contained in:
parent
f886237623
commit
23a21b33b1
@ -84,7 +84,9 @@ decltype(LogSink::messages) LogSink::GetMessages() const {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Message::Message(const char *section, Severity severity, const char *file, const char *func, int line) {
|
Message::Message(const char *section, Severity severity, const char *file, const char *func, int line)
|
||||||
|
: msg(buffer, sizeof buffer)
|
||||||
|
{
|
||||||
sm.section = section;
|
sm.section = section;
|
||||||
sm.severity = severity;
|
sm.severity = severity;
|
||||||
sm.file = file;
|
sm.file = file;
|
||||||
|
@ -139,6 +139,7 @@ public:
|
|||||||
class Message {
|
class Message {
|
||||||
std::ostrstream msg;
|
std::ostrstream msg;
|
||||||
SinkMessage sm;
|
SinkMessage sm;
|
||||||
|
char buffer[2048];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Message(const char *section, Severity severity, const char *file, const char *func, int line);
|
Message(const char *section, Severity severity, const char *file, const char *func, int line);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user