diff --git a/htdig-3.2.0b6-segfault.patch b/htdig-3.2.0b6-segfault.patch new file mode 100644 index 0000000..93a83d3 --- /dev/null +++ b/htdig-3.2.0b6-segfault.patch @@ -0,0 +1,137 @@ +--- htdig-3.2.0b6/htfuzzy/Regexp.cc.orig 2004-05-28 08:15:20.000000000 -0500 ++++ htdig-3.2.0b6/htfuzzy/Regexp.cc 2007-03-06 15:48:03.000000000 -0600 +@@ -73,16 +73,16 @@ + int wordCount = 0; + int maximumWords = config.Value("regex_max_words", 25); + +- wordList->Start_Get(); +- while (wordCount < maximumWords && (key = (String *) wordList->Get_Next())) +- { +- if (regexMatch.match(*key, 0, 0) != 0) +- { +- words.Add(new String(*key)); +- wordCount++; +- } +- } + if (wordList) { ++ wordList->Start_Get(); ++ while (wordCount < maximumWords && (key = (String *) wordList->Get_Next())) ++ { ++ if (regexMatch.match(*key, 0, 0) != 0) ++ { ++ words.Add(new String(*key)); ++ wordCount++; ++ } ++ } + wordList->Destroy(); + delete wordList; + } +--- htdig-3.2.0b6/htfuzzy/Substring.cc.orig 2004-05-28 08:15:20.000000000 -0500 ++++ htdig-3.2.0b6/htfuzzy/Substring.cc 2007-03-06 15:48:34.000000000 -0600 +@@ -73,16 +73,16 @@ + int wordCount = 0; + int maximumWords = config.Value("substring_max_words", 25); + +- wordList->Start_Get(); +- while (wordCount < maximumWords && (key = (String *) wordList->Get_Next())) +- { +- if (match.FindFirst((char*)*key) >= 0) +- { +- words.Add(new String(*key)); +- wordCount++; +- } +- } + if (wordList) { ++ wordList->Start_Get(); ++ while (wordCount < maximumWords && (key = (String *) wordList->Get_Next())) ++ { ++ if (match.FindFirst((char*)*key) >= 0) ++ { ++ words.Add(new String(*key)); ++ wordCount++; ++ } ++ } + wordList->Destroy(); + delete wordList; + } +--- htdig-3.2.0b6/htfuzzy/htfuzzy.cc.orig 2004-05-28 08:15:20.000000000 -0500 ++++ htdig-3.2.0b6/htfuzzy/htfuzzy.cc 2007-03-06 15:53:04.000000000 -0600 +@@ -153,8 +153,9 @@ + String word, fuzzyKey; + int count = 0; + +- words->Start_Get(); +- while ((key = (String *) words->Get_Next())) ++ if (words) ++ words->Start_Get(); ++ while (words && (key = (String *) words->Get_Next())) + { + word = *key; + wordAlgorithms.Start_Get(); +@@ -185,8 +186,11 @@ + fuzzy->writeDB(); + } + worddb.Close(); +- words->Destroy(); +- delete words; ++ if (words) ++ { ++ words->Destroy(); ++ delete words; ++ } + if (fuzzy) + delete fuzzy; + } +--- htdig-3.2.0b6/htfuzzy/Prefix.cc.orig 2004-05-28 08:15:20.000000000 -0500 ++++ htdig-3.2.0b6/htfuzzy/Prefix.cc 2007-03-06 15:58:13.000000000 -0600 +@@ -99,9 +99,10 @@ + WordReference *word_ref; + String last_word; + +- wordList->Start_Get(); +- while (wordCount < maximumWords && (word_ref = (WordReference *) wordList->Get_Next() )) +- { ++ if (wordList) { ++ wordList->Start_Get(); ++ while (wordCount < maximumWords && (word_ref = (WordReference *) wordList->Get_Next() )) ++ { + s = word_ref->Key().GetWord(); + + // If we're somehow past the original word, we're done +@@ -115,8 +116,7 @@ + last_word = s; + words.Add(new String(s)); + wordCount++; +- } +- if (wordList) { ++ } + wordList->Destroy(); + delete wordList; + } +--- htdig-3.2.0b6/htfuzzy/Fuzzy.cc.orig 2004-05-28 08:15:20.000000000 -0500 ++++ htdig-3.2.0b6/htfuzzy/Fuzzy.cc 2007-03-06 12:51:54.000000000 -0600 +@@ -61,7 +61,11 @@ + delete index; + index = 0; + } +- delete dict; ++ if (dict) ++ { ++ delete dict; ++ dict = 0; ++ } + } + + +@@ -154,8 +158,9 @@ + + int count = 0; + +- dict->Start_Get(); +- while ((fuzzyKey = dict->Get_Next())) ++ if (dict) ++ dict->Start_Get(); ++ while (dict && (fuzzyKey = dict->Get_Next())) + { + s = (String *) dict->Find(fuzzyKey); + index->Put(fuzzyKey, *s); diff --git a/htdig.spec b/htdig.spec index 02e58de..bf58b39 100644 --- a/htdig.spec +++ b/htdig.spec @@ -5,7 +5,7 @@ Summary: ht://Dig - Web search engine Name: htdig Version: 3.2.0b6 -Release: 10%{?dist} +Release: 11%{?dist} Epoch: 3 License: GPL Group: Applications/Internet @@ -23,7 +23,7 @@ Patch6: htdig-3.2.0b6-unescaped_output.patch Patch7: htdig-3.2.0b-versioncheck.patch Patch8: htdig-3.2.0b6-compile-fix.patch Patch9: htdig-3.2.0b6-opts.patch -#Patch10: htdig-3.2.0b6-sigfault.patch +Patch10: htdig-3.2.0b6-segfault.patch Patch11: htdig-3.2.0b6-incremental.patch BuildRequires: flex >= 2.5.4a-13 BuildRequires: zlib-devel httpd openssl-devel @@ -77,7 +77,7 @@ various web servers on the campus network. %patch7 -p1 -b .versioncheck %patch8 -p1 -b .compile-fix %patch9 -p1 -b .opts -#%patch10 -p1 -b .sigfault +%patch10 -p1 -b .segfault %patch11 -p1 -b .incremental %build @@ -96,7 +96,7 @@ various web servers on the campus network. --with-apache=/usr/sbin/httpd \ --with-zlib=/usr \ --with-ssl -make +make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT @@ -149,6 +149,10 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Wed Mar 07 2007 Adam Tkac 3:3.2.0b6-11.fc7 +- added upstream's segfault patch +- added ?_smp_mflags macro to make + * Thu Feb 01 2007 Adam Tkac 3:3.2.0b6-10.fc7 - removed sigfault patch because it isn't stable yet - changed common_dir in htdig.conf to /var/www/html/htdig (#220390)