|
From: <kar...@us...> - 2006-04-05 21:16:49
|
Revision: 1190 Author: karstenw Date: 2006-04-05 14:16:40 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1190&view=rev Log Message: ----------- nil dereference fix Modified Paths: -------------- Frontier/trunk/Common/UserLandIACToolkit/landgetparam.c Modified: Frontier/trunk/Common/UserLandIACToolkit/landgetparam.c =================================================================== --- Frontier/trunk/Common/UserLandIACToolkit/landgetparam.c 2006-04-04 19:02:48 UTC (rev 1189) +++ Frontier/trunk/Common/UserLandIACToolkit/landgetparam.c 2006-04-05 21:16:40 UTC (rev 1190) @@ -138,29 +138,35 @@ pascal boolean landgetlongparam (hdlverbrecord hverb, typaramkeyword key, long *x) { typaramrecord param; - + Handle theData; + boolean done = false; + if (!landgetparam (hverb, key, longtype, ¶m)) return (false); - #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ - - { - Handle h; - - copydatahandle (&(param.desc), &h); - - *x = **(long **) h; - } - - #else - - *x = **(long **) param.desc.dataHandle; - - #endif - + /* kw - 2006-02-19 --- don't dereference the nil handle... */ +#if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ + + if (copydatahandle (&(param.desc), &theData)) + { + lockhandle(theData); + + *x = **(long **) theData; + + unlockhandle(theData); + + disposehandle (theData); + + done = true; + } +#else + done = true; + *x = **(long **) param.desc.dataHandle; +#endif + landdisposeparamrecord (¶m); - return (true); + return (done); } /*landgetlongparam*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |