Commit 2fcfcc49 authored by Todd Carson's avatar Todd Carson Committed by Matthieu Herrb

Fix more unchecked lengths

Signed-off-by: Matthieu Herrb's avatarMatthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Matthieu Herrb's avatarMatthieu Herrb <matthieu@herrb.eu>
parent 388b303c
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment