commit 1fa505c4ad80469884962571ef13853f1be8dd08 from: Omar Polo via: Thomas Adam date: Thu Jun 15 11:27:15 2023 UTC gotwebd: disallow 1 for max_commits_display and report range errors ok stsp commit - 7272b60a19e7deee3a1808cbda935e201074c50d commit + 1fa505c4ad80469884962571ef13853f1be8dd08 blob - 920aff4245e78df0835a5a015cdb9431a5643348 blob + 0b1c88fa2ead6580ce2ca8a27bed7a836c4e54b2 --- gotwebd/parse.y +++ gotwebd/parse.y @@ -387,8 +387,12 @@ serveropts1 : REPOS_PATH STRING { new_srv->max_repos_display = $2; } | MAX_COMMITS_DISPLAY NUMBER { - if ($2 > 0) - new_srv->max_commits_display = $2; + if ($2 <= 1) { + yyerror("max_commits_display is too small:" + " %lld", $2); + YYERROR; + } + new_srv->max_commits_display = $2; } ;