Technical Q&As

NW 55 Workaround for PLookupName Bug (Updated 20-July-98)

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 MacOS X. The PLookupName as well as the other AppleTalk Manager calls will not be supported under MacOS 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, ...);


-- Rich Kubota

-- Revised by Rich Kubota

Worldwide Developer Technical Support

Technical Q&As
Previous Question | Next Question
Contents

To contact us, please use the Contact Us page.