From: <ro...@us...> - 2011-04-17 05:02:32
|
Revision: 52745 http://firebird.svn.sourceforge.net/firebird/?rev=52745&view=rev Author: robocop Date: 2011-04-17 05:02:26 +0000 (Sun, 17 Apr 2011) Log Message: ----------- Misc. Modified Paths: -------------- firebird/trunk/builds/win32/msvc9/codes.vcproj firebird/trunk/src/common/StatementMetadata.cpp firebird/trunk/src/common/StatementMetadata.h firebird/trunk/src/common/classes/condition.h firebird/trunk/src/yvalve/why.cpp Modified: firebird/trunk/builds/win32/msvc9/codes.vcproj =================================================================== --- firebird/trunk/builds/win32/msvc9/codes.vcproj 2011-04-17 05:00:56 UTC (rev 52744) +++ firebird/trunk/builds/win32/msvc9/codes.vcproj 2011-04-17 05:02:26 UTC (rev 52745) @@ -319,42 +319,6 @@ <File RelativePath="..\..\..\gen\misc\codes.cpp" > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - ObjectFile="$(IntDir)\$(InputName)1.obj" - XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|x64" - > - <Tool - Name="VCCLCompilerTool" - ObjectFile="$(IntDir)\$(InputName)1.obj" - XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - ObjectFile="$(IntDir)\$(InputName)1.obj" - XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|x64" - > - <Tool - Name="VCCLCompilerTool" - ObjectFile="$(IntDir)\$(InputName)1.obj" - XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" - /> - </FileConfiguration> </File> </Filter> <Filter Modified: firebird/trunk/src/common/StatementMetadata.cpp =================================================================== --- firebird/trunk/src/common/StatementMetadata.cpp 2011-04-17 05:00:56 UTC (rev 52744) +++ firebird/trunk/src/common/StatementMetadata.cpp 2011-04-17 05:02:26 UTC (rev 52745) @@ -333,6 +333,10 @@ } } + // CVC: This routine assumes the input is well formed, hence at least check we didn't read + // beyond the buffer's end, although I would prefer to make the previous code more robust. + fb_assert(buffer <= bufferEnd); + for (ObjectsArray<Parameters::Item>::iterator i = inputParameters.items.begin(); i != inputParameters.items.end() && inputParameters.fetched; ++i) Modified: firebird/trunk/src/common/StatementMetadata.h =================================================================== --- firebird/trunk/src/common/StatementMetadata.h 2011-04-17 05:00:56 UTC (rev 52744) +++ firebird/trunk/src/common/StatementMetadata.h 2011-04-17 05:02:26 UTC (rev 52745) @@ -43,7 +43,7 @@ public: struct Item : public PermanentStorage { - Item(MemoryPool& pool) + explicit Item(MemoryPool& pool) : PermanentStorage(pool), field(pool), relation(pool), @@ -71,7 +71,7 @@ }; public: - Parameters(MemoryPool& pool) + explicit Parameters(MemoryPool& pool) : PermanentStorage(pool), items(pool), fetched(false) @@ -87,99 +87,81 @@ { if (index < items.getCount()) return items[index].field.c_str(); - else - { - raiseIndexError(status, index, "getField"); - return NULL; - } + + raiseIndexError(status, index, "getField"); + return NULL; } virtual const char* FB_CARG getRelation(IStatus* status, unsigned index) const { if (index < items.getCount()) return items[index].relation.c_str(); - else - { - raiseIndexError(status, index, "getRelation"); - return NULL; - } + + raiseIndexError(status, index, "getRelation"); + return NULL; } virtual const char* FB_CARG getOwner(IStatus* status, unsigned index) const { if (index < items.getCount()) return items[index].owner.c_str(); - else - { - raiseIndexError(status, index, "getOwner"); - return NULL; - } + + raiseIndexError(status, index, "getOwner"); + return NULL; } virtual const char* FB_CARG getAlias(IStatus* status, unsigned index) const { if (index < items.getCount()) return items[index].alias.c_str(); - else - { - raiseIndexError(status, index, "getAlias"); - return NULL; - } + + raiseIndexError(status, index, "getAlias"); + return NULL; } virtual unsigned FB_CARG getType(IStatus* status, unsigned index) const { if (index < items.getCount()) return items[index].type; - else - { - raiseIndexError(status, index, "getType"); - return 0; - } + + raiseIndexError(status, index, "getType"); + return 0; } virtual bool FB_CARG isNullable(IStatus* status, unsigned index) const { if (index < items.getCount()) return items[index].nullable; - else - { - raiseIndexError(status, index, "isNullable"); - return false; - } + + raiseIndexError(status, index, "isNullable"); + return false; } virtual unsigned FB_CARG getSubType(IStatus* status, unsigned index) const { if (index < items.getCount()) return items[index].subType; - else - { - raiseIndexError(status, index, "getSubType"); - return 0; - } + + raiseIndexError(status, index, "getSubType"); + return 0; } virtual unsigned FB_CARG getLength(IStatus* status, unsigned index) const { if (index < items.getCount()) return items[index].length; - else - { - raiseIndexError(status, index, "getLength"); - return 0; - } + + raiseIndexError(status, index, "getLength"); + return 0; } virtual unsigned FB_CARG getScale(IStatus* status, unsigned index) const { if (index < items.getCount()) return items[index].scale; - else - { - raiseIndexError(status, index, "getScale"); - return 0; - } + + raiseIndexError(status, index, "getScale"); + return 0; } private: Modified: firebird/trunk/src/common/classes/condition.h =================================================================== --- firebird/trunk/src/common/classes/condition.h 2011-04-17 05:00:56 UTC (rev 52744) +++ firebird/trunk/src/common/classes/condition.h 2011-04-17 05:02:26 UTC (rev 52745) @@ -138,7 +138,8 @@ void init() { int err = pthread_cond_init(&cv, NULL); - if (err != 0) { + if (err != 0) + { //gds__log("Error on semaphore.h: constructor"); system_call_failed::raise("pthread_cond_init", err); } @@ -151,7 +152,8 @@ ~Condition() { int err = pthread_cond_destroy(&cv); - if (err != 0) { + if (err != 0) + { //gds__log("Error on semaphore.h: destructor"); //system_call_failed::raise("pthread_cond_destroy", err); } Modified: firebird/trunk/src/yvalve/why.cpp =================================================================== --- firebird/trunk/src/yvalve/why.cpp 2011-04-17 05:00:56 UTC (rev 52744) +++ firebird/trunk/src/yvalve/why.cpp 2011-04-17 05:02:26 UTC (rev 52745) @@ -1526,14 +1526,13 @@ if (!sqlda) return; - else - { - if (sqlda->version != SQLDA_VERSION1) - error804(isc_dsql_sqlda_err); - } - USHORT count = sqlda->sqld; + if (sqlda->version != SQLDA_VERSION1) + error804(isc_dsql_sqlda_err); + const USHORT count = sqlda->sqld; + fb_assert(count < MAX_USHORT / 2); // Nobody does this, but... + if (count == 0) return; // If there isn't an SQLDA, don't bother with anything else. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |