Coverity CID 468126

The datasize variable is an unsigned in, so comparing it to < 0 will
never be true. There is also a printf sequence for the variable which
should be %u rather than %d
This commit is contained in:
matt335672
2025-04-17 12:06:26 +01:00
parent c198b321a2
commit f2dd3fb3dc
+2 -2
View File
@@ -287,13 +287,13 @@ xrdp_font_create(struct xrdp_wm *wm, unsigned int dpi)
in_uint8s(s, 6);
datasize = FONT_DATASIZE(f);
if (datasize < 0 || datasize > 512)
if (datasize > 512)
{
/* shouldn't happen */
LOG(LOG_LEVEL_ERROR,
"xrdp_font_create: "
"datasize for U+%x wrong "
"width %d, height %d, datasize %d",
"width %d, height %d, datasize %u",
char_count, f->width, f->height, datasize);
break;
}