2011-01-26 19:08 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/src/pp/hbpp.c
    * modified syntax info to keep output well formatted for 80 columns
  * harbour/src/pp/hbpp.1
    * updated

  * harbour/src/rdd/dbf1.c
  * harbour/src/rdd/delim1.c
  * harbour/src/rdd/sdf1.c
  * harbour/contrib/rddsql/sqlbase.c
    ! added protection against GPF when wrong field index is passed to
      {GET|PUT}VALUE[FILE]() methods
This commit is contained in:
Przemyslaw Czerpak
2011-01-26 18:08:34 +00:00
parent c731995d06
commit 3444dfc907
7 changed files with 40 additions and 7 deletions

View File

@@ -16,6 +16,19 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-01-26 19:08 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/pp/hbpp.c
* modified syntax info to keep output well formatted for 80 columns
* harbour/src/pp/hbpp.1
* updated
* harbour/src/rdd/dbf1.c
* harbour/src/rdd/delim1.c
* harbour/src/rdd/sdf1.c
* harbour/contrib/rddsql/sqlbase.c
! added protection against GPF when wrong field index is passed to
{GET|PUT}VALUE[FILE]() methods
2011-01-26 18:06 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbnetio/utils/netiosrv/netiosrv.prg
* contrib/hbnetio/utils/netiosrv/netiocmd.prg

View File

@@ -462,6 +462,9 @@ static HB_ERRCODE sqlbaseDeleted( SQLBASEAREAP pArea, HB_BOOL* pDeleted )
static HB_ERRCODE sqlbaseGetValue( SQLBASEAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem )
{
if( uiIndex == 0 || uiIndex > pArea->area.uiFieldCount )
return HB_FAILURE;
if ( pArea->bRecordFlags & SQLDD_FLAG_CACHED )
{
hb_arrayGet( ( PHB_ITEM ) pArea->pRecord, uiIndex, pItem );
@@ -527,6 +530,9 @@ static HB_ERRCODE sqlbasePutValue( SQLBASEAREAP pArea, HB_USHORT uiIndex, PHB_IT
LPFIELD pField;
HB_ERRCODE errCode;
if( uiIndex == 0 || uiIndex > pArea->area.uiFieldCount )
return HB_FAILURE;
if ( ! pArea->fPositioned )
return HB_SUCCESS;

View File

@@ -19,6 +19,8 @@ C source code with preprocesor rules defined in given files.
.SH OPTIONS
.IP "\fB\-d\fR\fI<id>\fP[\fB=\fR\fI<val>\fP]" 16
#define \fR\fI<id>\fP
.IP "\fB-e\fP[\fR\fI<func>\fP]" 16
use \fR\fI<func>\fP as entry function in generated .c PP rules
.IP "\fB-i\fR\fI<path>\fP" 16
add #include file search path
.IP "\fB-u\fP[\fR\fI<file>\fP]" 16

View File

@@ -636,7 +636,7 @@ static void hb_pp_usage( char * szName )
printf( "\n" );
printf( "Syntax: %s <file[.prg]> [options]\n\n", szName );
printf( "Options: -d<id>[=<val>]\t#define <id>\n"
" -e[<func>] \tuse <func> as entry function in generated .c PP rules\n"
" -e[<func>] \tuse <func> as entry function in generated .c\n"
" -i<path> \tadd #include file search path\n"
" -u[<file>] \tuse command def set in <file> (or none)\n"
" -c[<file>] \tlook for ChangeLog file\n"

View File

@@ -1827,8 +1827,10 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI
if( !pArea->fValidBuffer && !hb_dbfReadRecord( pArea ) )
return HB_FAILURE;
if( --uiIndex >= pArea->area.uiFieldCount )
return HB_FAILURE;
fError = HB_FALSE;
uiIndex--;
pField = pArea->area.lpFields + uiIndex;
switch( pField->uiType )
{
@@ -2260,6 +2262,9 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI
if( !pArea->fValidBuffer && !hb_dbfReadRecord( pArea ) )
return HB_FAILURE;
if( --uiIndex >= pArea->area.uiFieldCount )
return HB_FAILURE;
if( !pArea->fPositioned )
return HB_SUCCESS;
@@ -2268,7 +2273,6 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI
return HB_FAILURE;
errCode = HB_SUCCESS;
uiIndex--;
pField = pArea->area.lpFields + uiIndex;
if( pField->uiType == HB_FT_MEMO ||
pField->uiType == HB_FT_IMAGE ||

View File

@@ -550,7 +550,9 @@ static HB_ERRCODE hb_delimGetValue( DELIMAREAP pArea, HB_USHORT uiIndex, PHB_ITE
HB_TRACE(HB_TR_DEBUG, ("hb_delimGetValue(%p, %hu, %p)", pArea, uiIndex, pItem));
--uiIndex;
if( --uiIndex >= pArea->area.uiFieldCount )
return HB_FAILURE;
pField = pArea->area.lpFields + uiIndex;
switch( pField->uiType )
{
@@ -651,8 +653,10 @@ static HB_ERRCODE hb_delimPutValue( DELIMAREAP pArea, HB_USHORT uiIndex, PHB_ITE
if( !pArea->fRecordChanged )
return HB_FAILURE;
if( --uiIndex >= pArea->area.uiFieldCount )
return HB_FAILURE;
errCode = HB_SUCCESS;
--uiIndex;
pField = pArea->area.lpFields + uiIndex;
if( pField->uiType != HB_FT_MEMO && pField->uiType != HB_FT_NONE )
{

View File

@@ -375,7 +375,9 @@ static HB_ERRCODE hb_sdfGetValue( SDFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI
HB_TRACE(HB_TR_DEBUG, ("hb_sdfGetValue(%p, %hu, %p)", pArea, uiIndex, pItem));
--uiIndex;
if( --uiIndex >= pArea->area.uiFieldCount )
return HB_FAILURE;
pField = pArea->area.lpFields + uiIndex;
switch( pField->uiType )
{
@@ -482,8 +484,10 @@ static HB_ERRCODE hb_sdfPutValue( SDFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI
if( !pArea->fRecordChanged )
return HB_FAILURE;
if( --uiIndex >= pArea->area.uiFieldCount )
return HB_FAILURE;
errCode = HB_SUCCESS;
--uiIndex;
pField = pArea->area.lpFields + uiIndex;
if( pField->uiType != HB_FT_MEMO && pField->uiType != HB_FT_NONE )
{