2016-04-06 15:18 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/common/hbstr.c
  * src/rtl/hbcom.c
  * src/rtl/hbproces.c
    * pacified few warnings - thanks to Viktor

  * contrib/sddfb/core.c
    ! fixed code which extracted float number from uninitialized memory.
      On some systems it could even cause GPF or other (ie. FPE) exception.
This commit is contained in:
Przemysław Czerpak
2016-04-06 15:18:50 +02:00
parent 97fd742f71
commit d2cfbe3d56
5 changed files with 16 additions and 9 deletions

View File

@@ -10,6 +10,16 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2016-04-06 15:18 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/common/hbstr.c
* src/rtl/hbcom.c
* src/rtl/hbproces.c
* pacified few warnings - thanks to Viktor
* contrib/sddfb/core.c
! fixed code which extracted float number from uninitialized memory.
On some systems it could even cause GPF or other (ie. FPE) exception.
2016-04-06 13:11 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbproces.c
! fixed infinite loop due to ignored POLLHUP errors reported by poll()

View File

@@ -379,7 +379,7 @@ static HB_ERRCODE fbOpen( SQLBASEAREAP pArea )
dbFieldInfo.uiDec = -pVar->sqlscale;
pVar->sqldata = ( char * ) hb_xgrab( sizeof( float ) );
pItem = hb_itemPutNDLen( NULL, *( float * ) pVar->sqldata, 20 - dbFieldInfo.uiDec, dbFieldInfo.uiDec );
pItem = hb_itemPutNDLen( NULL, 0.0, 20 - dbFieldInfo.uiDec, dbFieldInfo.uiDec );
break;
case SQL_DOUBLE:
@@ -388,7 +388,7 @@ static HB_ERRCODE fbOpen( SQLBASEAREAP pArea )
dbFieldInfo.uiDec = -pVar->sqlscale;
pVar->sqldata = ( char * ) hb_xgrab( sizeof( double ) );
pItem = hb_itemPutNDLen( NULL, *( float * ) pVar->sqldata, 20 - dbFieldInfo.uiDec, dbFieldInfo.uiDec );
pItem = hb_itemPutNDLen( NULL, 0.0, 20 - dbFieldInfo.uiDec, dbFieldInfo.uiDec );
break;
case SQL_TIMESTAMP:

View File

@@ -408,7 +408,7 @@ static double hb_numPow10( int nPrecision )
double hb_numRound( double dNum, int iDec )
{
static const double doBase = 10.0f;
static const double doBase = 10.0;
double doComplete5, doComplete5i, dPow;
HB_TRACE( HB_TR_DEBUG, ( "hb_numRound(%lf, %d)", dNum, iDec ) );
@@ -499,10 +499,10 @@ double hb_numRound( double dNum, int iDec )
doComplete5 = -doComplete5;
}
#else
if( dNum < 0.0f )
doComplete5 -= 5.0f;
if( dNum < 0.0 )
doComplete5 -= 5.0;
else
doComplete5 += 5.0f;
doComplete5 += 5.0;
#endif
doComplete5 /= doBase;

View File

@@ -579,7 +579,6 @@ static int hb_comCanRead( PHB_COM pCom, HB_MAXINT timeout )
}
break;
}
return iResult;
#else
struct timeval tv;
fd_set rfds;
@@ -684,7 +683,6 @@ static int hb_comCanWrite( PHB_COM pCom, HB_MAXINT timeout )
}
break;
}
return iResult;
#else
struct timeval tv;
fd_set wfds;

View File

@@ -1482,7 +1482,6 @@ int hb_fsProcessRun( const char * pszFileName,
{
HB_BOOL fStdout, fStderr, fStdin;
HB_SIZE nLen;
int iResult;
#if defined( HB_HAS_POLL )
{