From 2b98d23becf6cb17be22ba91514843e978587a23 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Fri, 29 Apr 2011 16:13:07 +0000 Subject: [PATCH] 2011-04-29 18:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rtl/filesys.c ! fixed time checking in *nix version of hb_fsPipeIsData() * harbour/contrib/hbwin/win_bmp.c ! fixed buffer overflow --- harbour/ChangeLog | 7 +++++++ harbour/contrib/hbwin/win_bmp.c | 2 +- harbour/src/rtl/filesys.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 79d65dde46..0e9f45d6ad 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2011-04-29 18:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rtl/filesys.c + ! fixed time checking in *nix version of hb_fsPipeIsData() + + * harbour/contrib/hbwin/win_bmp.c + ! fixed buffer overflow + 2011-04-29 11:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/hbqt_common.hbc * reverted: 2011-04-19 21:15 UTC+0200 Viktor Szakats diff --git a/harbour/contrib/hbwin/win_bmp.c b/harbour/contrib/hbwin/win_bmp.c index 130a95f56b..32300a6cd0 100644 --- a/harbour/contrib/hbwin/win_bmp.c +++ b/harbour/contrib/hbwin/win_bmp.c @@ -107,7 +107,7 @@ HB_FUNC( WIN_LOADBITMAPFILE ) [vszakats] */ if( nSize > 2 && nSize <= ( 32 * 1024 * 1024 ) ) { - void * pbmfh = hb_xgrab( nSize ); + void * pbmfh = hb_xgrab( nSize + 1 ); hb_fsSeek( fhnd, 0, FS_SET ); diff --git a/harbour/src/rtl/filesys.c b/harbour/src/rtl/filesys.c index 00bf46a7f9..dcb12b9f01 100644 --- a/harbour/src/rtl/filesys.c +++ b/harbour/src/rtl/filesys.c @@ -949,6 +949,8 @@ HB_SIZE hb_fsPipeIsData( HB_FHANDLE hPipeHandle, HB_SIZE nBufferSize, FD_SET( hPipeHandle, &rfds ); iResult = select( hPipeHandle + 1, &rfds, NULL, NULL, &tv ); hb_fsSetIOError( iResult >= 0, 0 ); + if( nTimeOut < 0 && iResult == 0 ) + continue; if( iResult != -1 || nTimeOut == 0 || errno != EINTR || hb_vmRequestQuery() != 0 ) break;