external/python3/ubsan.patch.0 | 13 +++++++++++++ 1 file changed, 13 insertions(+)
New commits: commit 28cd273a75b08d6dc5439e0b9c3a6ca766b17fce Author: Stephan Bergmann <[email protected]> AuthorDate: Wed Dec 17 09:50:04 2025 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Wed Dec 17 15:01:57 2025 +0100 Reapply external/python3/ubsan.patch.0 hunk ...that 241826dcb9bfa624e0761e6489b249b6fb507ea9 "python3: upgrade to 3.13.11 (master only)" had simply dropped, but which is still necessary to silence pointer-overflow issues as discussed in the commit message of fcaef01faf166db1f1609ac7227b9a795408296a "external/python3: Silence pointer-overflow" (now, it caused e.g. > [FIO] fcfg_database_others.xcu > Parser/lexer/buffer.c:30:41: runtime error: pointer index expression with base 0x7d8e21edb920 overflowed to 0xfffffffffffe2000 > #0 in _PyLexer_restore_fstring_buffers at workdir/UnpackedTarball/python3/Parser/lexer/buffer.c:30:41 > #1 in _PyLexer_tok_reserve_buf at workdir/UnpackedTarball/python3/Parser/lexer/buffer.c:73:9 > #2 in tok_readline_raw at workdir/UnpackedTarball/python3/Parser/tokenizer/file_tokenizer.c:59:14 [...] to fail during the build) Change-Id: Ib91feb446f6dfcbe3e60b8e3b54ac6503546ddda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195773 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0 index a6c3431f66c5..beed066c1b0b 100644 --- a/external/python3/ubsan.patch.0 +++ b/external/python3/ubsan.patch.0 @@ -32,3 +32,16 @@ for (i = 0; i < Py_SIZE(b); i++) { PyObject *v = src[i]; dest[i] = Py_NewRef(v); +--- Parser/lexer/buffer.c ++++ Parser/lexer/buffer.c +@@ -27,8 +27,8 @@ + + for (index = tok->tok_mode_stack_index; index >= 0; --index) { + mode = &(tok->tok_mode_stack[index]); +- mode->f_string_start = tok->buf + mode->f_string_start_offset; +- mode->f_string_multi_line_start = tok->buf + mode->f_string_multi_line_start_offset; ++ mode->f_string_start = (char *) (((intptr_t) tok->buf) + mode->f_string_start_offset); ++ mode->f_string_multi_line_start = (char *) (((intptr_t) tok->buf) + mode->f_string_multi_line_start_offset); + } + } +
