mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 964537 - Fix intermittent access through a null pointer. r=dmajor
This commit is contained in:
parent
ef95919928
commit
9768f063a8
@ -1185,8 +1185,14 @@ OomVictimLogger::Observe(
|
||||
for (size_t i = 0; i < regex_count; i++) {
|
||||
int matching = !regexec(&(mRegexes[i]), line_begin, 0, NULL, 0);
|
||||
if (matching) {
|
||||
// Log content of kernel message
|
||||
line_begin = strchr(line_begin, ']') + 2;
|
||||
// Log content of kernel message. We try to skip the ], but if for
|
||||
// some reason (most likely due to buffer overflow/wraparound), we
|
||||
// can't find the ] then we just log the entire line.
|
||||
char* endOfTimestamp = strchr(line_begin, ']');
|
||||
if (endOfTimestamp && endOfTimestamp[1] == ' ') {
|
||||
// skip the ] and the space that follows it
|
||||
line_begin = endOfTimestamp + 2;
|
||||
}
|
||||
if (!lineTimestampFound) {
|
||||
OOM_LOG(ANDROID_LOG_WARN, "following kill message may be a duplicate");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user