mirror of https://github.com/YosysHQ/abc.git
Adding out-of-bounds checks to AIGER readers.
This commit is contained in:
parent
98e377bdff
commit
0c070a35e5
|
|
@ -369,7 +369,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
|
||||||
|
|
||||||
// read signal names if they are of the special type
|
// read signal names if they are of the special type
|
||||||
pCur = pSymbols;
|
pCur = pSymbols;
|
||||||
if ( *pCur != 'c' )
|
if ( pCur < (unsigned char *)pContents + nFileSize && *pCur != 'c' )
|
||||||
{
|
{
|
||||||
int fBreakUsed = 0;
|
int fBreakUsed = 0;
|
||||||
unsigned char * pCurOld = pCur;
|
unsigned char * pCurOld = pCur;
|
||||||
|
|
|
||||||
|
|
@ -477,7 +477,7 @@ Abc_Ntk_t * Io_ReadAiger( char * pFileName, int fCheck )
|
||||||
|
|
||||||
// read the names if present
|
// read the names if present
|
||||||
pCur = pSymbols;
|
pCur = pSymbols;
|
||||||
if ( *pCur != 'c' )
|
if ( pCur < pContents + nFileSize && *pCur != 'c' )
|
||||||
{
|
{
|
||||||
int Counter = 0;
|
int Counter = 0;
|
||||||
while ( pCur < pContents + nFileSize && *pCur != 'c' )
|
while ( pCur < pContents + nFileSize && *pCur != 'c' )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue