look closely at:

>               qp->curdest = &qp->dest[j];

this just takes the address, it doesnt actually dereference anything. you
could write this as qp->curdest = qp->dest + j.

that destck(qp->curdest); call and the j >= Maxdest check after the
serveraddrs() call seem like a confused debug attempt to me. or is here
any reason why serveraddrs() should *not* fill the whole array up
to the last element and stop at Maxdest-2?

look how qp->curdest is used in the code. it is a pointer pointing *past*
the last filled entry (or represents the next entry to be filled). if the
whole array is filled, it should point at qp->dest + Maxdest (and serveraddrs
even checked exactly for that).

except that bogus destck(), dp->curdest is never dereferenced in the code
and just used in loops as the end marker with the p < dp->curdest or
p != dp->curdest condition.

--
cinap

Reply via email to