Fix out-of-bound with short layers names in GdsDriver::GdsStream.

* Bug: In CRL::GdsDriver::GdsStream::operator<<(Cell*), when looking for
    layer names ending with ".pin", must also check that the string is
    at least 4 characters long.
This commit is contained in:
Jean-Paul Chaput 2021-10-15 18:39:07 +02:00
parent f58212eb96
commit d6b01a557a
1 changed files with 1 additions and 1 deletions

View File

@ -821,7 +821,7 @@ namespace {
const BasicLayer* exportLayer = layer;
if (NetExternalComponents::isExternal(component)) {
string layerName = getString( layer->getName() );
if (layerName.substr(layerName.size()-4) != ".pin") {
if ((layerName.size() > 4) and (layerName.substr(layerName.size()-4) != ".pin")) {
exportLayer = tech->getBasicLayer( layerName+".pin" );
if (not exportLayer) exportLayer = layer;
}