guarding against invalid files passed to 'odoc' apple event, see #14384

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2012-07-02 11:47:29 +00:00
parent 3ac2562a7f
commit 0161592b25

View File

@@ -161,9 +161,13 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply))
wxArrayString fileNames; wxArrayString fileNames;
for (i = 1; i <= itemsInList; i++) for (i = 1; i <= itemsInList; i++)
{ {
AEGetNthPtr( err = AEGetNthPtr(
&docList, i, typeFSRef, &keywd, &returnedType, &docList, i, typeFSRef, &keywd, &returnedType,
(Ptr)&theRef, sizeof(theRef), &actualSize); (Ptr)&theRef, sizeof(theRef), &actualSize);
if ( err != noErr)
return err;
fName = wxMacFSRefToPath( &theRef ) ; fName = wxMacFSRefToPath( &theRef ) ;
fileNames.Add(fName); fileNames.Add(fName);