summaryrefslogtreecommitdiff
path: root/merge-blobs.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2022-12-01 15:47:15 +0100
committerJunio C Hamano <gitster@pobox.com>2022-12-09 14:26:21 +0900
commitf930a2394303b902e2973f4308f96529f736b8bc (patch)
treeda1d18e7ea7b15b5239af1aeffbb051b68a35f23 /merge-blobs.c
parent81c2d4c3a5ba0e6ab8c348708441fed170e63a82 (diff)
utf8: refactor `strbuf_utf8_replace` to not rely on preallocated buffer
In `strbuf_utf8_replace`, we preallocate the destination buffer and then use `memcpy` to copy bytes into it at computed offsets. This feels rather fragile and is hard to understand at times. Refactor the code to instead use `strbuf_add` and `strbuf_addstr` so that we can be sure that there is no possibility to perform an out-of-bounds write. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-blobs.c')
0 files changed, 0 insertions, 0 deletions