Fix SIGSEGV while compiling dthelp on 64 bit systems.
Patch from Ulrich Wilkens <mail@uwilkens.de> 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.
This commit is contained in:
@@ -106,3 +106,9 @@ M_WCHAR *w_strstr(
|
|||||||
M_WCHAR *string1, M_WCHAR *string2
|
M_WCHAR *string1, M_WCHAR *string2
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void *m_malloc(
|
||||||
|
#if defined(M_PROTO)
|
||||||
|
int size, char *msg
|
||||||
|
#endif
|
||||||
|
) ;
|
||||||
|
|||||||
@@ -106,3 +106,9 @@ M_WCHAR *w_strstr(
|
|||||||
M_WCHAR *string1, M_WCHAR *string2
|
M_WCHAR *string1, M_WCHAR *string2
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void *m_malloc(
|
||||||
|
#if defined(M_PROTO)
|
||||||
|
int size, char *msg
|
||||||
|
#endif
|
||||||
|
) ;
|
||||||
|
|||||||
@@ -106,3 +106,9 @@ M_WCHAR *w_strstr(
|
|||||||
M_WCHAR *string1, M_WCHAR *string2
|
M_WCHAR *string1, M_WCHAR *string2
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void *m_malloc(
|
||||||
|
#if defined(M_PROTO)
|
||||||
|
int size, char *msg
|
||||||
|
#endif
|
||||||
|
) ;
|
||||||
|
|||||||
@@ -112,3 +112,9 @@ M_WCHAR *w_strstr(
|
|||||||
M_WCHAR *string1, M_WCHAR *string2
|
M_WCHAR *string1, M_WCHAR *string2
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void *m_malloc(
|
||||||
|
#if defined(M_PROTO)
|
||||||
|
int size, char *msg
|
||||||
|
#endif
|
||||||
|
) ;
|
||||||
|
|||||||
Reference in New Issue
Block a user