ADC Home > Reference Library > Technical Q&As > Legacy Documents > Networking >

Legacy Documentclose button

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:

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 PLookupName 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 PLookupName call and does not occur with the Open Transport equivalent - OTLookupName.

The preferred solution to this bug is to upgrade your networking code to use the Open Transport OTLookupName call rather than the outdated PLookupName call. OTLookupName will be supported under Mac OS X. The PLookupName as well as the other AppleTalk 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.

char buffer[1024];
gPBLkUP->myMPP.NBPretBuffSize = sizeof(buffer) - 2;
gPBLkUP->myMPP.NBPretBuffPtr = &buffer;
result = PLookupName((MPPParamBlock *) &myMPP, ...);

[Jul 20 1998]

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.