Skip to content

Commit

Permalink
Added range check for db id in dbNetwork -- move this to database cod…
Browse files Browse the repository at this point in the history
…e, once hierarchy brought up. Signed-off-by:Andy Fox <[email protected]>

Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Jun 6, 2024
1 parent 917f192 commit c655c47
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dbSta/src/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ static constexpr unsigned DBIDTAG_WIDTH = 0x4;

ObjectId dbNetwork::getDbNwkObjectId(dbObjectType typ, ObjectId db_id) const
{
if (db_id > (std::numeric_limits<ObjectId>::max() >> DBIDTAG_WIDTH)) {
logger_->error(ORD, 2019, "Error: database id exceeds capacity");
}

switch (typ) {
case dbITermObj: {
return ((db_id << DBIDTAG_WIDTH) | DBITERM_ID);
Expand Down

0 comments on commit c655c47

Please sign in to comment.