Skip to content

Commit

Permalink
fix: rid of UB in qt/rpcconsole.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
knst authored and PastaPastaPasta committed Jun 7, 2023
1 parent 028281a commit 6b87c21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,9 @@ void RPCConsole::setFontSize(int newSize)
{
QSettings settings;

newSize = std::min(std::max(newSize, FONT_RANGE.width()), FONT_RANGE.height());
//don't allow an insane font size
if (newSize < FONT_RANGE.width() || newSize > FONT_RANGE.height())
return;

// temp. store the console content
QString str = ui->messagesWidget->toHtml();
Expand Down

0 comments on commit 6b87c21

Please sign in to comment.