[PATCH v2] kernelbase: Implement SetCurrentConsoleFontEx
Hugh McMaster
hugh.mcmaster at outlook.com
Wed Feb 9 05:17:40 CST 2022
Hi Jacek,
On Wed, 9 Feb 2022 at 08:04, Jacek Caban wrote:
>
> > + while (*p && len < LF_FACESIZE) { p++; len++; }
> > + size = len * sizeof(WCHAR);
>
> This could be simplified to:
>
> size = wcsnlen( info->FaceName, LF_FACESIZE - 1 ) * sizeof(WCHAR);
[snip]
>
> > @@ -1917,6 +1917,24 @@ static NTSTATUS set_output_info( struct screen_buffer *screen_buffer,
> > screen_buffer->max_width = info->max_width;
> > screen_buffer->max_height = info->max_height;
> > }
> > + if (params->mask & SET_CONSOLE_OUTPUT_INFO_FONT)
> > + {
> > + WCHAR *face_name = (WCHAR *)(params + 1);
> > + size_t face_name_size = in_size - sizeof(*params);
> > + unsigned int height = info->font_height;
> > + unsigned int weight = FW_NORMAL;
> > +
> > + if (!*face_name)
>
>
> You potentially check uninitialized bytes here, I think you meant
> something like:
>
> if (face_name_size)
Good pick-ups on both points. I've sent a revised patch.
More information about the wine-devel
mailing list