Skip to content

Commit fbb119a

Browse files
Fix breakpad patch for IsValidCrashReportId
This patch was introduced in the past to accept a backtrace. Recently though changes upstream changed exactly the patched lines in question to use an algorithm-based approach to check for the format of the ID. This change creates a local function in a shadow file to act as a proxy to make sure we preserve the `-` check as well as a valid id character. Original issue: brave/brave-browser#14326 Chromium change: https://chromium.googlesource.com/chromium/src/+/b999986ff24699b81ecd3f45254a4bdf0332698a commit b999986ff24699b81ecd3f45254a4bdf0332698a Author: Peter Kasting <[email protected]> Date: Wed Oct 25 03:54:27 2023 +0000 Shorten code by using existing helper APIs, eliminating temps. No functional change. Bug: none
1 parent 48cd4a1 commit fbb119a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

patches/components-crash-core-app-breakpad_linux.cc.patch

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ index 81578d1e0928a8f67922054864ec777cf2d0ddfe..94997072e4399a27e83fad6258cc3e5d
55
@@ -1461,7 +1461,7 @@ bool IsValidCrashReportId(const char* buf, size_t bytes_read,
66
return my_strcmp(buf, "_sys_cr_finished") == 0;
77
#else
8-
for (size_t i = 0; i < bytes_read; ++i) {
9-
- if (!my_isxdigit(buf[i]))
10-
+ if (!my_isxdigit(buf[i]) && buf[i] != '-')
11-
return false;
12-
}
13-
return true;
14-
@@ -1954,7 +1954,7 @@ void HandleCrashDump(const BreakpadInfo& info) {
8+
return base::ranges::all_of(base::span(buf, bytes_read),
9+
- base::IsHexDigit<char>);
10+
+ IsHexDigitOrDash<char>);
11+
#endif
12+
}
13+
14+
@@ -1950,7 +1950,7 @@ void HandleCrashDump(const BreakpadInfo& info) {
1515
if (upload_child > 0) {
1616
IGNORE_RET(sys_close(fds[1])); // Close write end of pipe.
1717

0 commit comments

Comments
 (0)