mirror of
https://github.com/leozide/leocad.git
synced 2026-09-12 01:23:35 +00:00
Fixed buffer overflow with parts with very long descriptions.
This commit is contained in:
+2
-1
@@ -308,7 +308,8 @@ void lcPiece::CreateName(const lcArray<Piece*>& Pieces)
|
||||
max = i;
|
||||
}
|
||||
|
||||
sprintf (m_strName, "%s #%.2d", mPieceInfo->m_strDescription, max+1);
|
||||
snprintf(m_strName, sizeof(m_strName), "%s #%.2d", mPieceInfo->m_strDescription, max+1);
|
||||
m_strName[sizeof(m_strName) - 1] = 0;
|
||||
}
|
||||
|
||||
void lcPiece::InsertTime(unsigned short start, unsigned short time)
|
||||
|
||||
Reference in New Issue
Block a user