Skip to content

Commit

Permalink
Merge pull request #10538 from AbelPau/Solving-Issue-70860-from-oss-fuzz
Browse files Browse the repository at this point in the history
MiraMonVector: fix Issue 70860 in oss-fuzz
  • Loading branch information
rouault authored Aug 2, 2024
2 parents b47c958 + 87f1063 commit 563ab57
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ogr/ogrsf_frmts/miramon/ogrmiramonlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,7 @@ OGRErr OGRMiraMonLayer::TranslateFieldsValuesToMM(OGRFeature *poFeature)
MM_EXT_DBF_N_FIELDS nNumFields = m_poFeatureDefn->GetFieldCount();
MM_EXT_DBF_N_MULTIPLE_RECORDS nNumRecords, nRealNumRecords;
hMMFeature.nNumMRecords = 0;
#define MAX_SIZE_OF_FIELD_NUMBER_WITH_MINUS 22

for (MM_EXT_DBF_N_FIELDS iField = 0; iField < nNumFields; iField++)
{
Expand Down Expand Up @@ -2427,7 +2428,7 @@ OGRErr OGRMiraMonLayer::TranslateFieldsValuesToMM(OGRFeature *poFeature)
hMMFeature.pRecords[nIRecord].nNumField))
return OGRERR_NOT_ENOUGH_MEMORY;

char szChain[21];
char szChain[MAX_SIZE_OF_FIELD_NUMBER_WITH_MINUS];
MM_SprintfDoubleSignifFigures(
szChain, sizeof(szChain),
phMiraMonLayer->pLayerDB->pFields[iField].nNumberOfDecimals,
Expand Down Expand Up @@ -2643,7 +2644,7 @@ OGRErr OGRMiraMonLayer::TranslateFieldsValuesToMM(OGRFeature *poFeature)
hMMFeature.pRecords[0].pField[iField].bIsValid = 0;
else
{
char szChain[21];
char szChain[MAX_SIZE_OF_FIELD_NUMBER_WITH_MINUS];
MM_SprintfDoubleSignifFigures(
szChain, sizeof(szChain),
phMiraMonLayer->pLayerDB->pFields[iField].nNumberOfDecimals,
Expand Down

0 comments on commit 563ab57

Please sign in to comment.