Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/21a734bcfac12324e72dc2ce6bcb47a54353dad0
>---------------------------------------------------------------
commit 21a734bcfac12324e72dc2ce6bcb47a54353dad0
Author: Rohitab Batra <
roh...@rohitab.com>
Date: Mon Oct 20 08:58:49 2025 +1100
gh-1032: Crash if size of name column is less than size of mark character
>---------------------------------------------------------------
21a734bcfac12324e72dc2ce6bcb47a54353dad0
far/changelog | 5 +++++
far/filelist.cpp | 15 +++++++++------
far/vbuild.m4 | 2 +-
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/far/changelog b/far/changelog
index de613068f..e2cc27572 100644
--- a/far/changelog
+++ b/far/changelog
@@ -1,3 +1,8 @@
+--------------------------------------------------------------------------------
+rohitab 2025-10-20 08:50:41+11:00 - build 6574
+
+1. gh-1032: Crash if size of name column is less than size of mark character.
+
--------------------------------------------------------------------------------
drkns 2025-10-16 23:42:46+01:00 - build 6573
diff --git a/far/filelist.cpp b/far/filelist.cpp
index 7e0870e72..96dfa10b1 100644
--- a/far/filelist.cpp
+++ b/far/filelist.cpp
@@ -8754,14 +8754,17 @@ void FileList::ShowList(int ShowStatus,int StartColumn)
if (Global->Opt->Highlight && m_ListData[ListPos].Colors && !m_ListData[ListPos].Colors->Mark.Mark.empty() && Width>1)
{
const auto MarkLength = visual_string_length(m_ListData[ListPos].Colors->Mark.Mark);
- Width -= static_cast<int>(MarkLength);
+ if (Width >= MarkLength)
+ {
+ Width -= static_cast<int>(MarkLength);
- const auto OldColor = GetColor();
- if (!ShowStatus)
- SetShowColor(ListPos, false);
+ const auto OldColor = GetColor();
+ if (!ShowStatus)
+ SetShowColor(ListPos, false);
- Text(m_ListData[ListPos].Colors->Mark.Mark, MarkLength);
- SetColor(OldColor);
+ Text(m_ListData[ListPos].Colors->Mark.Mark, MarkLength);
+ SetColor(OldColor);
+ }
}
string_view Name = m_ListData[ListPos].AlternateOrNormal(m_ShowShortNames);
diff --git a/far/vbuild.m4 b/far/vbuild.m4
index 4dcb373bc..4b820e832 100644
--- a/far/vbuild.m4
+++ b/far/vbuild.m4
@@ -1 +1 @@
-6573
+6574