ADC Home > Reference Library > Technical Q&As > Legacy Documents > Networking >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
Technical Q&A NW55
Workaround for PLookupName Bug
Q: I've found that there is a bug with how
Open Transport handles the NBP
PLookupName call? How can I work
around this problem?
A: To expound, there is a bug with how
OpenTransport (up to and including v 1.3) handles the NBP
call, such that Open Transport can write past the end of the lookup
buffer by up to 2 bytes. The problem only applies to the
call and does not occur with the Open Transport equivalent -
The preferred solution to this bug is to upgrade your networking
code to use the Open Transport
OTLookupName call rather than the
OTLookupName will be supported under
Mac OS X. The
PLookupName as well as the other
Manager calls will not be supported under
Mac OS X.
The alternate solution is to set the
NBPretBuffSize parameter to
be 2 bytes less than the actual size of the buffer pointed to by
NBPretBuffPtr as shown in the code below. This solution will work for
all releases of Open Transport and will not be affected if the
problem is fixed by Open Transport.
gPBLkUP->myMPP.NBPretBuffSize = sizeof(buffer) - 2;
gPBLkUP->myMPP.NBPretBuffPtr = &buffer;
result = PLookupName((MPPParamBlock *) &myMPP, ...);
[Jul 20 1998]