From f42fa885beb74797b50d23008d766b1d2d3de12d Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Mon, 6 Aug 2012 22:42:34 -0600 Subject: [PATCH] Fix SIGSEGV while compiling dthelp on 64 bit systems. Patch from Ulrich Wilkens 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. --- cde/programs/dthelp/parser.ccdf/htag/util/basic.h | 6 ++++++ cde/programs/dthelp/parser/canon1/util/basic.h | 6 ++++++ cde/programs/dthelp/parser/pass1/util/basic.h | 6 ++++++ cde/programs/dthelp/parser/pass2/util/basic.h | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/basic.h b/cde/programs/dthelp/parser.ccdf/htag/util/basic.h index 5e5580ec..223b30a1 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 b1b2d775..f505123b 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 dc410050..301422a5 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 31755a18..38c93edc 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 + ) ; -- 2.25.1