1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-17 20:34:58 +00:00

bstr: change memcpy to memmove to allow aliased copies

mp_property_expand_escaped_string() needs this.

Found by OSS-Fuzz.
This commit is contained in:
Kacper Michajłow 2024-06-25 17:16:45 +02:00
parent 5995f13b5f
commit 22fc2e6af3

View File

@ -371,7 +371,7 @@ void bstr_xappend(void *talloc_ctx, bstr *s, bstr append)
if (!append.len)
return;
resize_append(talloc_ctx, s, append.len + 1);
memcpy(s->start + s->len, append.start, append.len);
memmove(s->start + s->len, append.start, append.len);
s->len += append.len;
s->start[s->len] = '\0';
}