bounds check when loading font

ulab-original
jsorg71 19 years ago
parent 8fd2618101
commit eef98128fc

@ -108,6 +108,13 @@ xrdp_font_create(struct xrdp_wm* wm)
f->incby = i; f->incby = i;
in_uint8s(s, 6); in_uint8s(s, 6);
datasize = FONT_DATASIZE(f); datasize = FONT_DATASIZE(f);
if (datasize < 0 || datasize > 512)
{
/* shouldn't happen */
g_writeln("error in xrdp_font_create, datasize wrong");
g_writeln("%d %d %d", f->width, f->height, datasize);
break;
}
if (s_check_rem(s, datasize)) if (s_check_rem(s, datasize))
{ {
f->data = (char*)g_malloc(datasize, 0); f->data = (char*)g_malloc(datasize, 0);

Loading…
Cancel
Save