This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
abc/abc-format.patch
Jerry James b9a9aef6cb Update to latest git snapshot
Drop upstreamed patches: overflow, use-after-free
2023-07-14 11:18:48 -06:00

120 lines
5.8 KiB
Diff

--- src/base/abci/abc.c.orig 2023-07-08 11:18:18.000000000 -0600
+++ src/base/abci/abc.c 2023-07-14 11:14:10.263628991 -0600
@@ -23905,7 +23905,7 @@ int Abc_CommandSymFun( Abc_Frame_t * pAb
printf( "%s\n", pTruth );
// read the truth table to be the current network in ABC
pCommand = ABC_CALLOC( char, strlen(pTruth) + 100 );
- sprintf( pCommand, "read_truth %s", pTruth );
+ snprintf( pCommand, strlen(pTruth) + 100, "read_truth %s", pTruth );
Cmd_CommandExecute( pAbc, pCommand );
ABC_FREE( pCommand );
ABC_FREE( pTruth );
@@ -45189,7 +45189,7 @@ int Abc_CommandAbc9Cone( Abc_Frame_t * p
Gia_ManForEachPo( pAbc->pGia, pObj, i )
{
Gia_Man_t * pOne = Gia_ManDupDfsCone( pAbc->pGia, pObj );
- sprintf( Buffer, "%s_%0*d.aig", Extra_FileNameGeneric(pAbc->pGia->pSpec), nDigits, i );
+ snprintf( Buffer, 1000, "%s_%0*d.aig", Extra_FileNameGeneric(pAbc->pGia->pSpec), nDigits, i );
Gia_AigerWrite( pOne, Buffer, 0, 0, 0 );
Gia_ManStop( pOne );
}
--- src/base/io/ioReadBlifMv.c.orig 2023-07-14 11:12:54.591767465 -0600
+++ src/base/io/ioReadBlifMv.c 2023-07-14 11:13:13.259486615 -0600
@@ -1627,7 +1627,7 @@ static int Io_MvParseLineMv( Io_MvMod_t
***********************************************************************/
static int Io_MvWriteValues( Abc_Obj_t * pNode, Vec_Str_t * vFunc )
{
- char Buffer[10];
+ char Buffer[12];
Abc_Obj_t * pFanin;
int i;
// add the fanin number of values
--- src/base/wlc/wlcNtk.c.orig 2023-07-08 11:18:18.000000000 -0600
+++ src/base/wlc/wlcNtk.c 2023-07-14 10:51:19.721294579 -0600
@@ -1300,7 +1300,7 @@ void Wlc_NtkShortNames( Wlc_Ntk_t * p )
{
if ( Wlc_ObjIsPo(pObj) )
continue;
- sprintf( pBuffer, "%s%0*d", "fi", nDigits, i - Wlc_NtkPoNum(p) );
+ snprintf( pBuffer, 1000, "%s%0*d", "fi", nDigits, i - Wlc_NtkPoNum(p) );
NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound );
Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId );
}
@@ -1308,21 +1308,21 @@ void Wlc_NtkShortNames( Wlc_Ntk_t * p )
{
if ( Wlc_ObjIsPi(pObj) )
continue;
- sprintf( pBuffer, "%s%0*d", "fo", nDigits, i - Wlc_NtkPiNum(p) );
+ snprintf( pBuffer, 1000, "%s%0*d", "fo", nDigits, i - Wlc_NtkPiNum(p) );
NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound );
Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId );
}
nDigits = Abc_Base10Log( Wlc_NtkPoNum(p) );
Wlc_NtkForEachPo( p, pObj, i )
{
- sprintf( pBuffer, "%s%0*d", "po", nDigits, i );
+ snprintf( pBuffer, 1000, "%s%0*d", "po", nDigits, i );
NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound );
Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId );
}
nDigits = Abc_Base10Log( Wlc_NtkPiNum(p) );
Wlc_NtkForEachPi( p, pObj, i )
{
- sprintf( pBuffer, "%s%0*d", "pi", nDigits, i );
+ snprintf( pBuffer, 1000, "%s%0*d", "pi", nDigits, i );
NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound );
Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId );
}
@@ -1331,7 +1331,7 @@ void Wlc_NtkShortNames( Wlc_Ntk_t * p )
{
if ( Wlc_ObjIsCi(pObj) || Wlc_ObjIsCo(pObj) )
continue;
- sprintf( pBuffer, "%s%0*d", "n", nDigits, i );
+ snprintf( pBuffer, 1000, "%s%0*d", "n", nDigits, i );
NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound );
Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId );
}
--- src/map/mio/mioUtils.c.orig 2023-07-08 11:18:18.000000000 -0600
+++ src/map/mio/mioUtils.c 2023-07-14 10:47:26.983819441 -0600
@@ -1716,7 +1716,7 @@ void Mio_LibraryShortNames( Mio_Library_
Mio_LibraryForEachGate( pLib, pGate )
{
ABC_FREE( pGate->pName );
- sprintf( Buffer, "g%0*d", nDigits, ++c );
+ snprintf( Buffer, 10000, "g%0*d", nDigits, ++c );
pGate->pName = Abc_UtilStrsav( Buffer );
// update formula
Mio_LibraryShortFormula( pGate, pGate->pForm, Buffer );
--- src/map/scl/sclLibUtil.c.orig 2023-07-08 11:18:18.000000000 -0600
+++ src/map/scl/sclLibUtil.c 2023-07-14 10:47:26.983819441 -0600
@@ -205,7 +205,7 @@ void Abc_SclShortNames( SC_Lib * p )
SC_RingForEachCell( pClass, pCell, k )
{
ABC_FREE( pCell->pName );
- sprintf( Buffer, "g%0*d_%0*d", nDigits, i, nDigits2, k );
+ snprintf( Buffer, 10000, "g%0*d_%0*d", nDigits, i, nDigits2, k );
pCell->pName = Abc_UtilStrsav( Buffer );
// formula
SC_CellForEachPinOut( pCell, pPin, n )
--- src/opt/dau/dauMerge.c.orig 2023-07-08 11:18:18.000000000 -0600
+++ src/opt/dau/dauMerge.c 2023-07-14 10:47:26.983819441 -0600
@@ -715,7 +715,7 @@ Dau_DsdMergeStorePrintDefs( pS );
// create new function
// assert( nVarsTotal <= 6 );
- sprintf( pS->pOutput, "(%s%s)", pDsd0, pDsd1 );
+ snprintf( pS->pOutput, DAU_MAX_STR, "(%s%s)", pDsd0, pDsd1 );
pTruth = Dau_DsdToTruth( pS->pOutput, nVarsTotal );
Status = Dau_DsdDecompose( pTruth, nVarsTotal, 0, 1, pS->pOutput );
//printf( "%d ", Status );
--- src/proof/fra/fraCore.c.orig 2023-07-08 11:18:18.000000000 -0600
+++ src/proof/fra/fraCore.c 2023-07-14 10:47:26.983819441 -0600
@@ -163,7 +163,7 @@ static inline void Fra_FraigNodeSpeculat
// create manager with the logic for these two nodes
pTemp = Aig_ManExtractMiter( p->pManFraig, pObjFraig, pObjReprFraig );
// dump the logic into a file
- sprintf( FileName, "aig\\%03d.blif", ++Counter );
+ snprintf( FileName, 20U, "aig\\%03d.blif", ++Counter );
Aig_ManDumpBlif( pTemp, FileName, NULL, NULL );
printf( "Speculation cone with %d nodes was written into file \"%s\".\n", Aig_ManNodeNum(pTemp), FileName );
// clean up