Date: Fri, 23 Apr 2004 12:02:22 +0200 From: Alex Kiesel To: htdig-general@lists.sourceforge.net Subject: Re: [htdig] 'htfuzzy soundex' segfaulting On Thu, 2004-04-22 at 19:02, Alex Kiesel wrote: > htfuzzy soundex then segfaults. I ran it with strace: > $ strace htfuzzy -v soundex -c /etc/htdig/htdig.conf I've produced a more informational backtrace by compiling it from source and trying again. The problem occurs when one has activated the option allow_numbers: true and tried to run 'htfuzzy soundex' on the database files. As numbers from a string are being skipped in Soundex::generateKey(), a segfault occurs as the char *word is being increased by while (!isalpha(*word)) word++; if the given word contains numbers only (or: contains only nonalpha chars, to be precise). The attached diff[1] fixes this problem for me, it's a diff against htdig 3.1.6, file htdig-3.1.6/htfuzzy/Soundex.cc Regards, -Alex (Slightly modified to apply to 3.2.0b5) Regards, Joe --- htfuzzy/Soundex.cc.orig Fri Apr 23 11:42:11 2004 +++ htfuzzy/Soundex.cc Fri Apr 26 14:15:53 2004 @@ -59,10 +59,11 @@ return; } - while (!isalpha(*word)) + while (!isalpha(*word) && *word != '\0') { word++; + } - if (word) + if (*word) { key << *word++; }