Reset freed HGDI_DC
authorakallabeth <akallabeth@posteo.net>
Tue, 2 Jun 2020 07:28:47 +0000 (09:28 +0200)
committerArmin Novak <armin.novak@thincast.com>
Mon, 22 Jun 2020 10:13:20 +0000 (12:13 +0200)
CVE-2020-4031 thanks to @antonio-morales for finding this.

(cherry picked from commit f753c25ad3d5dae7890fe73cfb3c091c015d97ed)

libfreerdp/gdi/graphics.c

index f63df39..60d82ae 100644 (file)
@@ -93,6 +93,7 @@ static BOOL gdi_Bitmap_New(rdpContext* context, rdpBitmap* bitmap)
        if (!gdi_bitmap->bitmap)
        {
                gdi_DeleteDC(gdi_bitmap->hdc);
+               gdi_bitmap->hdc = NULL;
                return FALSE;
        }