#5 getservbyname skips 1st service in list

closed-fixed
nobody
Networking (2)
5
2002-10-28
2002-04-26
Anonymous
No

getservbyname and getservbyport skip the first
service entry in the list.

A possible fix would be to change
GUSINetDB::getservent to save off it's return value
prior to incrementing the iterator.

servent * GUSINetDB::getservent()
{
servent * retVal;

if (!fServiceOpen)
setservent(0);
retVal = *fServiceIter;
if (fServiceIter == GUSIServiceDB::end())
endservent();
else
++fServiceIter;

return retVal;
}

Discussion

    • status: open --> open-fixed
     
  • Logged In: YES
    user_id=37219

    GUSINetDB.nw,1.13

     
    • status: open-fixed --> closed-fixed