> Objects/listobject.c:1370:37: runtime error: applying zero offset to null pointer > #0 0x7f38b863523a in list_extend_dictitems /workdir/UnpackedTarball/python3/Objects/listobject.c:1370:37 > #1 0x7f38b862a555 in _list_extend /workdir/UnpackedTarball/python3/Objects/listobject.c:1435:15 > #2 0x7f38b8651977 in list___init___impl /workdir/UnpackedTarball/python3/Objects/listobject.c:3467:13 > #3 0x7f38b86305d3 in list_vectorcall /workdir/UnpackedTarball/python3/Objects/listobject.c:3491:13 [...] as seen while building workdir/XcuFilterFiltersTarget/fcfg_impress_filters.xcu etc. at <https://ci.libreoffice.org/job/lo_ubsan/3756/>. (Same as 314c4b5ef949f5bb1a4f13048726c440e556ba67 "external/python3: Silence UBSan 'applying zero offset to null pointer'", this only gets reported with old Clang prior to Clang 20 <https://github.com/llvm/llvm-project/commit/4847395c5459f9c476808f9337abdae7fbd78a23> "[Clang] Adjust pointer-overflow sanitizer for N3322 (#120719)".) Change-Id: I15129f5fa3eb3c0f92d6e3a80f914f63e12efdb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195894 Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com> Tested-by: Jenkins
66 lines
2.3 KiB
Plaintext
66 lines
2.3 KiB
Plaintext
--- Modules/posixmodule.c
|
|
+++ Modules/posixmodule.c
|
|
@@ -13998,6 +13998,9 @@
|
|
};
|
|
|
|
static int
|
|
+#if defined __clang__
|
|
+__attribute__((no_sanitize("shift-base"))) // MFD_HUGE_16GB in /usr/include/linux/memfd.h
|
|
+#endif
|
|
all_ins(PyObject *m)
|
|
{
|
|
#ifdef F_OK
|
|
--- Objects/dictobject.c
|
|
+++ Objects/dictobject.c
|
|
@@ -2105,7 +2105,7 @@
|
|
if (unicode) { // combined unicode -> combined unicode
|
|
PyDictUnicodeEntry *newentries = DK_UNICODE_ENTRIES(newkeys);
|
|
if (oldkeys->dk_nentries == numentries && mp->ma_keys->dk_kind == DICT_KEYS_UNICODE) {
|
|
- memcpy(newentries, oldentries, numentries * sizeof(PyDictUnicodeEntry));
|
|
+ memcpy(newentries, (void *) oldentries, numentries * sizeof(PyDictUnicodeEntry));
|
|
}
|
|
else {
|
|
PyDictUnicodeEntry *ep = oldentries;
|
|
--- Objects/listobject.c
|
|
+++ Objects/listobject.c
|
|
@@ -539,7 +539,7 @@
|
|
dest[i] = Py_NewRef(v);
|
|
}
|
|
src = b->ob_item;
|
|
- dest = np->ob_item + Py_SIZE(a);
|
|
+ dest = Py_SIZE(a) == 0 ? np->ob_item : np->ob_item + Py_SIZE(a);
|
|
for (i = 0; i < Py_SIZE(b); i++) {
|
|
PyObject *v = src[i];
|
|
dest[i] = Py_NewRef(v);
|
|
@@ -1325,7 +1325,7 @@
|
|
Py_ssize_t setpos = 0;
|
|
Py_hash_t hash;
|
|
PyObject *key;
|
|
- PyObject **dest = self->ob_item + m;
|
|
+ PyObject **dest = m == 0 ? self->ob_item : self->ob_item + m;
|
|
while (_PySet_NextEntryRef((PyObject *)other, &setpos, &key, &hash)) {
|
|
FT_ATOMIC_STORE_PTR_RELEASE(*dest, key);
|
|
dest++;
|
|
@@ -1367,7 +1367,7 @@
|
|
return -1;
|
|
}
|
|
|
|
- PyObject **dest = self->ob_item + m;
|
|
+ PyObject **dest = m == 0 ? self->ob_item : self->ob_item + m;
|
|
Py_ssize_t pos = 0;
|
|
Py_ssize_t i = 0;
|
|
PyObject *key, *value;
|
|
--- 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);
|
|
}
|
|
}
|
|
|