mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-40998: Address compiler warnings found by ubsan (GH-20929)
Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: GH:tiran
(cherry picked from commit 07f2adedf0
)
Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
802ff7c0d3
commit
994c68f586
4 changed files with 13 additions and 5 deletions
|
@ -847,7 +847,11 @@ xmlcharrefreplace(_PyBytesWriter *writer, char *str,
|
|||
|
||||
/* generate replacement */
|
||||
for (i = collstart; i < collend; ++i) {
|
||||
str += sprintf(str, "&#%d;", PyUnicode_READ(kind, data, i));
|
||||
size = sprintf(str, "&#%d;", PyUnicode_READ(kind, data, i));
|
||||
if (size < 0) {
|
||||
return NULL;
|
||||
}
|
||||
str += size;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue