commit - 031687baf3081932383b85041c49de781c43e432
commit + 1a0c81fb613b80af38dbc7f37c12f42a34b363d6
blob - 686908558b4951371e282ff25989e0b4eb8eb819
blob + 8e765c5a8d213bc5f3bc28783185c77337ca0e30
--- gotwebd/parse.y
+++ gotwebd/parse.y
free($1);
}
| ON { $$ = 1; }
- | NUMBER { $$ = $1; }
+ | NUMBER {
+ if ($1 != 0 && $1 != 1) {
+ yyerror("invalid boolean value '%lld'", $1);
+ YYERROR;
+ }
+ $$ = $1;
+ }
;
fcgiport : PORT NUMBER {
;
main : PREFORK NUMBER {
+ if ($2 <= 0 || $2 > PROC_MAX_INSTANCES) {
+ yyerror("prefork is %s: %lld",
+ $2 <= 0 ? "too small" : "too large", $2);
+ YYERROR;
+ }
gotwebd->prefork_gotwebd = $2;
}
| CHROOT STRING {
free($4);
}
| MAX_REPOS NUMBER {
- if ($2 > 0)
- new_srv->max_repos = $2;
+ if ($2 <= 0) {
+ yyerror("max_repos is too small: %lld", $2);
+ YYERROR;
+ }
+ new_srv->max_repos = $2;
}
| SHOW_SITE_OWNER boolean {
new_srv->show_site_owner = $2;
new_srv->respect_exportok = $2;
}
| MAX_REPOS_DISPLAY NUMBER {
- new_srv->max_repos_display = $2;
+ if ($2 <= 0) {
+ yyerror("max_repos_display is too small: %lld",
+ $2);
+ YYERROR;
+ }
+ new_srv->max_repos_display = $2;
}
| MAX_COMMITS_DISPLAY NUMBER {
if ($2 <= 1) {