From 1f85a9ac77b81018b730a33e8594fce0289a8036 Mon Sep 17 00:00:00 2001 From: Droid Date: Wed, 21 Jan 2026 14:09:19 +0400 Subject: [PATCH] fix: disallow setting max_file_size to 0 in config --- src/cli/commands.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cli/commands.rs b/src/cli/commands.rs index f128499..7c16e57 100644 --- a/src/cli/commands.rs +++ b/src/cli/commands.rs @@ -1113,6 +1113,9 @@ fn run_config(action: Option, config: &mut Config) -> Result<()> { } ConfigKey::MaxFileSize => { let size: u64 = value.parse().context("Invalid size")?; + if size == 0 { + anyhow::bail!("Max file size must be greater than 0"); + } config.set_max_file_size(size * 1024)?; format!("max_file_size = {} KB", size) }