Skip to content
Commit 764e9a03 authored by Martin Sebor's avatar Martin Sebor Committed by Siddhesh Poyarekar
Browse files

Correct buffer end pointer in IO_wdefault_doallocate (BZ #26874)



An experimental build of GCC 11 with an enhanced -Warray-bounds
reports a bug in IO_wdefault_doallocate where the function forms
an invalid past-the-end pointer to an allocated wchar_t buffer
by failingf to consider the scaling by sizeof (wchar_t).

The fix path below corrects this problem.  It keeps the buffer
size the same as opposed to increasing it according to what other
code like it does.

Reviewed-by: default avatarSiddhesh Poyarekar <siddhesh@sourceware.org>
parent 9fb07fd4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment