1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

64bit: Fix crash in dtexec

No ANSI prototype for malloc() caused
the returned pointer to be truncated
to 32 bits.
This commit is contained in:
Marcin Cieslak 2012-08-23 16:40:38 +02:00 committed by Jon Trulson
parent d31fc60fbf
commit 98b17d3551
3 changed files with 13 additions and 9 deletions

View file

@ -40,6 +40,7 @@
#ifndef NO_MESSAGE_CATALOG #ifndef NO_MESSAGE_CATALOG
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <nl_types.h> #include <nl_types.h>
#include "DtSvcLock.h" #include "DtSvcLock.h"

View file

@ -145,7 +145,7 @@ static char * get_file_name (
va_list args; va_list args;
file = malloc(MAXPATHLEN+1); file = malloc(MAXPATHLEN+1);
if (! file) return; if (! file) return NULL;
Va_start (args, format); Va_start (args, format);

View file

@ -59,6 +59,9 @@
#include "osdep.h" /* select(2) mask width and bit manipulation macros */ #include "osdep.h" /* select(2) mask width and bit manipulation macros */
#include <Tt/tt_c.h> #include <Tt/tt_c.h>
#include <locale.h> #include <locale.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <Dt/MsgLog.h> #include <Dt/MsgLog.h>
@ -320,7 +323,7 @@ Help(
*****************************************************************************/ *****************************************************************************/
static void static void
#if defined(__aix) || defined (__osf__) #if defined(__aix) || defined (__osf__) || defined(__FreeBSD__)
PanicSignal(int s) PanicSignal(int s)
#else #else
PanicSignal(void) PanicSignal(void)
@ -357,7 +360,7 @@ PanicSignal(void)
*****************************************************************************/ *****************************************************************************/
static void static void
#if defined(__aix) || defined (__osf__) #if defined(__aix) || defined (__osf__) || defined(__FreeBSD__)
IgnoreSignal(int i) IgnoreSignal(int i)
#else #else
IgnoreSignal(void) IgnoreSignal(void)
@ -399,7 +402,7 @@ IgnoreSignal(void)
*****************************************************************************/ *****************************************************************************/
static void static void
#if defined(__aix) || defined (__osf__) #if defined(__aix) || defined (__osf__) || defined(__FreeBSD__)
UrgentSignal(int i) UrgentSignal(int i)
#else #else
UrgentSignal(void) UrgentSignal(void)
@ -450,7 +453,7 @@ UrgentSignal(void)
* *
*****************************************************************************/ *****************************************************************************/
static void static void
#if defined(__aix) || defined (__osf__) #if defined(__aix) || defined (__osf__) || defined(__FreeBSD__)
SigCld(int i) SigCld(int i)
#else #else
SigCld(void) SigCld(void)
@ -769,7 +772,7 @@ ParseCommandLine(
#endif /* _DTEXEC_NLS16 */ #endif /* _DTEXEC_NLS16 */
if (tick2) if (tick2)
*tick2 = NULL; *tick2 = 0;
#ifdef _DTEXEC_NLS16 #ifdef _DTEXEC_NLS16
tick1 = (char *) Dt_strrchr( dtSvcProcIdG, '_' ); tick1 = (char *) Dt_strrchr( dtSvcProcIdG, '_' );
@ -778,8 +781,8 @@ ParseCommandLine(
#endif /* _DTEXEC_NLS16 */ #endif /* _DTEXEC_NLS16 */
if ( tick1 && tick2 ) { if ( tick1 && tick2 ) {
*tick1 = NULL; *tick1 = 0;
*tick2 = NULL; *tick2 = 0;
dtSvcInvIdG = atoi((char *) (tick1 + 1)); dtSvcInvIdG = atoi((char *) (tick1 + 1));
dtSvcChildIdG = atoi((char *) (tick2 + 1)); dtSvcChildIdG = atoi((char *) (tick2 + 1));
@ -1520,7 +1523,7 @@ main (
* a SIGCLD, give up and exit. * a SIGCLD, give up and exit.
*/ */
if (rediscoverUrgentSigG > ((1000/SHORT_SELECT_TIMEOUT)*5) ) { if (rediscoverUrgentSigG > ((1000/SHORT_SELECT_TIMEOUT)*5) ) {
#if defined(__aix) || defined (__osf__) #if defined(__aix) || defined (__osf__) || defined(__FreeBSD__)
PanicSignal(0); PanicSignal(0);
#else #else
PanicSignal(); PanicSignal();