mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-08 12:38:04 +02:00
_XimEncodingNegotiation: swap order of arguments to calloc
Avoids build failures with gcc 14.2 when MALLOC_0_RETURNS_NULL is defined:
imDefIm.c: In function ‘_XimEncodingNegotiation’:
imDefIm.c:1739:15: error: ‘memcpy’ offset 8 is out of the bounds [0, 1]
[-Werror=array-bounds=]
1739 | (void)memcpy((char *)&buf_s[2], name_ptr, name_len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/267>
This commit is contained in:
parent
1f01aafa6d
commit
75c5bdee81
1 changed files with 1 additions and 1 deletions
|
|
@ -1728,7 +1728,7 @@ _XimEncodingNegotiation(
|
|||
+ sizeof(CARD16)
|
||||
+ detail_len;
|
||||
|
||||
if (!(buf = Xcalloc(XIM_HEADER_SIZE + len, 1)))
|
||||
if (!(buf = Xcalloc(1, XIM_HEADER_SIZE + len)))
|
||||
goto free_detail_ptr;
|
||||
|
||||
buf_s = (CARD16 *)&buf[XIM_HEADER_SIZE];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue