W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1999

HTAnchor bug

From: Mikhail Grouchinski <mgrouch@usa.net>
Date: 3 Mar 99 17:27:35 EST
Message-ID: <19990303222735.19522.qmail@www0h.netaddress.usa.net>
To: www-lib@w3.org
HTAnchor.c bug...

I've found a bug in HTAnchor.c 

function: HTAnchor_findAddress()

This loop skips the first object in a list and leads to segmentation fault.

while ((foundAnchor = (HTParentAnchor *) HTList_nextObject(grownups)))
{
...
}

Should be 

    HTTRACE(ANCH_TRACE, "Anchor...... grownups count = %d\n" _
HTList_count(grownups));
    foundAnchor = grownups; 
    while (foundAnchor)  {
        if (!strcmp(foundAnchor->address, newaddr)) {
		HTTRACE(ANCH_TRACE, "Find Parent. %p with address `%s' already exists.\n" _ 
			    (void*) foundAnchor _ newaddr);
		HT_FREE(newaddr);		       /* We already have it */
		return (HTAnchor *) foundAnchor;
	}
        foundAnchor = (HTParentAnchor *) HTList_nextObject(grownups);
    }


____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1
Received on Wednesday, 3 March 1999 17:27:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:29 GMT