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:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user