1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

riched20: Don't write past end of buffer.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
This commit is contained in:
Eric Pouech 2023-12-13 15:12:38 +01:00 committed by Alexandre Julliard
parent 015aae30cf
commit 5cbe3a6cb1

View file

@ -4309,7 +4309,7 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen,
str = get_text( run, 0 );
}
/* append '\r' to the last paragraph. */
if (run == para_end_run( para_prev( editor_end_para( editor ) ) ) && bEOP)
if (run == para_end_run( para_prev( editor_end_para( editor ) ) ) && bEOP && buflen)
{
*buffer = '\r';
buffer ++;