Author: tfaber Date: Tue Jun 13 13:12:55 2017 New Revision: 75020
URL: http://svn.reactos.org/svn/reactos?rev=75020&view=rev Log: [WIN32K:NTUSER] - Avoid crash on invalid format in UserEnumClipboardFormats. This is covered by user32_winetest but we currently fail that call before it can crash. The next commit will change that. CORE-13414
Modified: trunk/reactos/win32ss/user/ntuser/clipboard.c
Modified: trunk/reactos/win32ss/user/ntuser/clipboard.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/clipboa... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] Tue Jun 13 13:12:55 2017 @@ -448,9 +448,14 @@ { /* Return next format */ pElement = IntGetFormatElement(pWinStaObj, fmt); - ++pElement; - if (pElement < &pWinStaObj->pClipBase[pWinStaObj->cNumClipFormats]) - Ret = pElement->fmt; + if (pElement != NULL) + { + ++pElement; + if (pElement < &pWinStaObj->pClipBase[pWinStaObj->cNumClipFormats]) + { + Ret = pElement->fmt; + } + } }
cleanup: