PATCH: metafile escape filter

Marcus Meissner marcus at jet.franken.de
Thu Jan 5 15:48:17 CST 2006


Hi,

Next try.

Ciao, Marcus

Changelog:
	Only allow a small whitelist of escapes to be retrieved
	from metafiles.

Index: dlls/gdi/metafile.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/metafile.c,v
retrieving revision 1.11
diff -u -r1.11 metafile.c
--- dlls/gdi/metafile.c	3 Jan 2006 12:43:52 -0000	1.11
+++ dlls/gdi/metafile.c	5 Jan 2006 21:45:13 -0000
@@ -863,6 +863,25 @@
         break;
 
     case META_ESCAPE:
+        switch (mr->rdParm[0]) {
+        case NEWFRAME:
+        case ABORTDOC:
+        case NEXTBAND:
+        case SETCOLORTABLE:
+        case FLUSHOUTPUT:
+        case DRAFTMODE:
+        case STARTDOC:
+        case ENDDOC:
+        case SETCOPYCOUNT:
+        case SETLINECAP:
+        case SETLINEJOIN:
+        case SETMITERLIMIT:
+        case DRAWPATTERNRECT:
+        case ENABLEDUPLEX:
+        default:
+            FIXME("Filtering Escape(%d), potential virus or missing in whitelist.\n", mr->rdParm[0]);
+            return FALSE;
+        }
         Escape(hdc, mr->rdParm[0], mr->rdParm[1], (LPCSTR)&mr->rdParm[2], NULL);
         break;
 



More information about the wine-patches mailing list