htdig: core dumps in mystrncasecmp
Tue, 10 Mar 1998 14:32:39 +0100


First of all, thanks a lot for providing such a fine search engine.

I don't know if the following problem has been discused before, but
here is what happened recently:

When running htdig-3.0.8b2 on sparc/solaris251, it dropped core ("Buss error")
after several hours. gdb showed that the offending function was mystrncasecmp in
htlib/ One of the char* arguments (str2) was ==NULL; the subsequent
*str2 caused the core dump.

Here's the stack trace:

#0 0x2a574 in mystrncasecmp (str1=0x3bea0 " \t", str2=0x0, n=5) at
#1 0x1c9f4 in Document::readHeader (this=0x99468, c=@0xefffd958) at
#2 0x1c594 in Document::Retrieve (this=0x99468, date=0) at
#3 0x1fbc0 in Retriever::parse_url (this=0xeffffb48, urlRef=@0x58620) at
#4 0x1f9fc in Retriever::Start (this=0xeffffb48) at
#5 0x222b0 in main (ac=356136, av=0xeffffd5c) at

I inserted some checks in the beginning of mystrncasecmp; since then, htdig runs flawlessly :-)

        if (!str1 && !str2) return 0;
        if (!str1) return 1;
        if (!str2) return -1;
        if (n<0) return 0;

Hope that helps,

Bernhard Griener

Those who would have nothing to do with thorns must never attempt to
gather flowers.
To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the body of the message.

This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:25:49 PST