Microsoft KB Archive/193909

{|
 * width="100%"|

BUG: GetBestRoute Hangs Windows 98 if Invalid Pointer Is Passed

 * }

Q193909

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), on platform(s):
 * the operating system: Microsoft Windows 98

-

SYMPTOMS
If you call the GetBestRoute API and pass an invalid (non NULL) value for pBestRoute, a pointer to the MIB_IPFORWARDROW structure might cause Windows 98 to hang. You have to restart your computer.

If you call the API with pBestRoute == NULL, the API returns ERROR_INVALID_PARAMETER, which is expected behavior.

RESOLUTION
This API should never be called with an uninitialized pointer. Either initialize the pointer to NULL, assign it the value returned by malloc or new, or pass in the address of a MIB_IPFORWARDROW structure (the recommended way as demonstrated below).

Sample Code
   IPAddr            DestAddress;  // 4-byte unsigned int. IPAddr           SrcAddress;   // 4-byte unsigned int. MIB_IPFORWARDROW BestRoute;    // Route structure to get the route.

// Assign the proper destination and source address to   // DestAddress and SrcAddress.

// Pass the address of BestRoute to GetBestRoute, thus ensuring // a valid address is passed to the API. status = GetBestRoute(DestAddress, SrcAddress, &BestRoute)

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Additional query words: IPHLPAPI

Keywords : kbnetwork kbAPI kbSDKPlatform kbOSWin98bug kbIPHelp kbGrpDSNet

Issue type : kbbug

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch