mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-08 10:18:04 +02:00
Fix more unchecked lengths
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
This commit is contained in:
parent
388b303c62
commit
2fcfcc49f3
1 changed files with 4 additions and 3 deletions
|
|
@ -321,7 +321,7 @@ _XimAttributeToValue(
|
|||
|
||||
case XimType_XFontSet:
|
||||
{
|
||||
INT16 len = data[0];
|
||||
CARD16 len = data[0];
|
||||
char *base_name;
|
||||
XFontSet rep = (XFontSet)NULL;
|
||||
char **missing_list = NULL;
|
||||
|
|
@ -332,11 +332,12 @@ _XimAttributeToValue(
|
|||
return False;
|
||||
if (!ic)
|
||||
return False;
|
||||
|
||||
if (len > data_len)
|
||||
return False;
|
||||
if (!(base_name = Xmalloc(len + 1)))
|
||||
return False;
|
||||
|
||||
(void)strncpy(base_name, (char *)&data[1], (int)len);
|
||||
(void)strncpy(base_name, (char *)&data[1], (size_t)len);
|
||||
base_name[len] = '\0';
|
||||
|
||||
if (mode & XIM_PREEDIT_ATTR) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue