Skip to content

Commit

Permalink
SdfWriter::write format_delay_ possible overflow
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Jan 13, 2022
1 parent 2befa80 commit 4e0d2d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions liberty/LibertyParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,9 @@ makeLibertyComplexAttr(const char *name,
group->addAttribute(attr);
return attr;
}
else {
delete attr;
return nullptr;
}
}
delete attr;
return nullptr;
}
}

Expand Down
3 changes: 1 addition & 2 deletions sdf/SdfWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ SdfWriter::write(const char *filename,
sdf_divider_ = sdf_divider;
include_typ_ = include_typ;
if (delay_format_ == nullptr)
delay_format_ = new char[10];
sprintf(delay_format_, "%%.%df", digits);
delay_format_ = stringPrint("%%.%df", digits);

LibertyLibrary *default_lib = network_->defaultLibertyLibrary();
timescale_ = default_lib->units()->timeUnit()->scale();
Expand Down

0 comments on commit 4e0d2d9

Please sign in to comment.