Merge pull request #2437 from matt335672/fix_font_use_after_free

Fix regression use-after-free
This commit is contained in:
matt335672 2022-11-23 11:13:51 +00:00 committed by GitHub
commit 791db0998a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -574,8 +574,11 @@ xrdp_wm_init(struct xrdp_wm *self)
load_xrdp_config(self->xrdp_config, self->session->xrdp_ini,
self->screen->bpp);
/* Load the font */
/* Remove a font loaded on the previous config */
xrdp_font_delete(self->default_font);
self->painter->font = NULL; /* May be set to the default_font */
/* Load the font */
dpi = xrdp_login_wnd_get_monitor_dpi(self);
self->default_font = xrdp_font_create(self, dpi);