|
From: Ulrich W. <ma...@uw...> - 2012-08-07 03:47:12
|
Hello,
I have a little patch for a problem that I found when I tried to compile
dthelp on 64bit FreeBSD. It could also be a problem on other 64bit systems.
The problem is that the program context compiles but fails running with
segmentation fault.
context uses the function m_malloc() which is missing a correct
prototype sometimes. Then it's treated to return int instead of void * .
On 64bit systems this cuts off the higher 32 bits because void * is
64bit whereas int is only 32bit.
Here's the patch:
diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/basic.h
b/cde/programs/dthelp/parser.ccdf/htag/util/basic.h
index 5e5580e..223b30a 100644
--- a/cde/programs/dthelp/parser.ccdf/htag/util/basic.h
+++ b/cde/programs/dthelp/parser.ccdf/htag/util/basic.h
@@ -106,3 +106,9 @@ M_WCHAR *w_strstr(
M_WCHAR *string1, M_WCHAR *string2
#endif
);
+
+void *m_malloc(
+#if defined(M_PROTO)
+ int size, char *msg
+#endif
+ ) ;
diff --git a/cde/programs/dthelp/parser/canon1/util/basic.h
b/cde/programs/dthelp/parser/canon1/util/basic.h
index b1b2d77..f505123 100644
--- a/cde/programs/dthelp/parser/canon1/util/basic.h
+++ b/cde/programs/dthelp/parser/canon1/util/basic.h
@@ -106,3 +106,9 @@ M_WCHAR *w_strstr(
M_WCHAR *string1, M_WCHAR *string2
#endif
);
+
+void *m_malloc(
+#if defined(M_PROTO)
+ int size, char *msg
+#endif
+) ;
diff --git a/cde/programs/dthelp/parser/pass1/util/basic.h
b/cde/programs/dthelp/parser/pass1/util/basic.h
index dc41005..301422a 100644
--- a/cde/programs/dthelp/parser/pass1/util/basic.h
+++ b/cde/programs/dthelp/parser/pass1/util/basic.h
@@ -106,3 +106,9 @@ M_WCHAR *w_strstr(
M_WCHAR *string1, M_WCHAR *string2
#endif
);
+
+void *m_malloc(
+#if defined(M_PROTO)
+ int size, char *msg
+#endif
+ ) ;
diff --git a/cde/programs/dthelp/parser/pass2/util/basic.h
b/cde/programs/dthelp/parser/pass2/util/basic.h
index 31755a1..38c93ed 100644
--- a/cde/programs/dthelp/parser/pass2/util/basic.h
+++ b/cde/programs/dthelp/parser/pass2/util/basic.h
@@ -112,3 +112,9 @@ M_WCHAR *w_strstr(
M_WCHAR *string1, M_WCHAR *string2
#endif
);
+
+void *m_malloc(
+#if defined(M_PROTO)
+ int size, char *msg
+#endif
+ ) ;
|