Hello,
here are some fixes for dtinfo segfaults. They occured if you tried
to use the search engine. Unfortunately the search engine is still
not fixed, but now you get a corresponding message and dtinfo doesn't crash.
Please apply it after the NetBSD patch.
--
Ulrich Wilkens
Email: m...@uwilkens.de
>From a74e92ba209fdbd2500a408dce24178317fd592a Mon Sep 17 00:00:00 2001
From: Ulrich Wilkens <m...@uwilkens.de>
Date: Thu, 20 Feb 2014 19:48:56 +0100
Subject: [PATCH] Fix for dtinfo segfaults
---
cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C | 8 --------
cde/programs/dtinfo/dtinfo/src/Query/QueryGroup.C | 2 +-
cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C | 9 +++++++--
cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c | 2 +-
4 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C
b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C
index a7c912b..0f3f14d 100644
--- a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C
+++ b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C
@@ -141,11 +141,7 @@ IcccmAgent::value_handler(Widget w, XtPointer ia, Atom
*selection,
free(wcs);
}
#endif
-#if 0
(((IcccmAgent*)ia)->*f_string_handler)((char*)value, *length);
-#else
- (((IcccmAgent*)f_real_object)->*f_string_handler)((char*)value,
*length);
-#endif
XtFree((char*)value);
}
else if (*type == XA_COMPOUND_TEXT(XtDisplay(w))) {
@@ -168,11 +164,7 @@ IcccmAgent::value_handler(Widget w, XtPointer ia, Atom
*selection,
*((char *) memcpy(mbs, string_list[i], len) + len) = '\0';
}
XwcFreeStringList((wchar_t**)string_list);
-#if 0
(((IcccmAgent*)ia)->*f_string_handler)(mbs, strlen(mbs));
-#else
- (((IcccmAgent*)f_real_object)->*f_string_handler)(mbs, strlen(mbs));
-#endif
free((void*)mbs);
}
else {
diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryGroup.C
b/cde/programs/dtinfo/dtinfo/src/Query/QueryGroup.C
index 09a0921..3be6fae 100644
--- a/cde/programs/dtinfo/dtinfo/src/Query/QueryGroup.C
+++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryGroup.C
@@ -383,7 +383,7 @@ QueryGroup::gen_query_internal (query_type_t query_type)
int
QueryGroup::format (query_type_t query_type, QueryTerm *term)
{
- char *s = (char*)"\001s", *tmp;
+ char *s = strdup("\001s"), *tmp;
// Need two buffers for alternating writes.
// Allocate a buffer with enough room for term plus operators.
static char *buf[2];
diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C
b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C
index 137cc1f..b2262f9 100644
--- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C
+++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C
@@ -620,6 +620,11 @@ DtSR_SearchEngine::search(UAS_String oql, UAS_SearchScope&
scope,
UAS_String msg(CATGETS(Set_DtSR_SearchEngine, 1,
"DtSearch does not support the query."));
DtSearchFreeMessages();
+
+ if (current_bc != 0) {
+ targets.remove(current_bc);
+ current_bc = NULL;
+ }
throw(CASTUASEXCEPT UAS_Exception(msg));
continue;
@@ -692,10 +697,10 @@ DtSR_SearchEngine::search(UAS_String oql,
UAS_SearchScope& scope,
UAS_Pointer<DtSR_Stems> stems = bookcases[index]->takeover_stems();
UAS_Pointer<UAS_String> q = new UAS_String(oql);
- UAS_Pointer<UAS_String> n = new UAS_String(scope.name());
+ UAS_Pointer<UAS_String> s = new UAS_String(scope.name());
UAS_Pointer<DtSR_SearchResults> DtSR_res =
- new DtSR_SearchResults(q, n, res, res->length(),
+ new DtSR_SearchResults(q, s, res, res->length(),
stems, scope.search_zones(), stype);
if (DtSR_result == (int)0)
diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c
b/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c
index 35b2148..1e8e96d 100644
--- a/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c
+++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c
@@ -1867,7 +1867,7 @@ buildTOC(int argc, char *argv[])
len = MIN(strlen(gStruct->id), MAXPATHLEN);
*((char *) memcpy (idBuf, gStruct->id, len) + len) = '\0';
len = MIN(strlen(gStruct->title), MAXPATHLEN);
- *((char *) memcpy (titleBuf, gStruct->id, len) + len) = '\0';
+ *((char *) memcpy (titleBuf, gStruct->title, len) + len) = '\0';
if (checkStat(gStruct->outFile, FSTAT_IS_FILE))
{
--
1.7.11.5
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel