commit 912db690abe419dd5f82d9ea6ecf351ab2c48f00 from: Stefan Sperling via: Thomas Adam date: Fri Jan 06 09:33:00 2023 UTC enforce gotd request timeout > 0; the code doesn't handle zero right now spotted by + ok op@ commit - c7c382950394eeda4875e2da6812e05c61a291d3 commit + 912db690abe419dd5f82d9ea6ecf351ab2c48f00 blob - 709ffeed62560387b52252f4db644c469348ebfc blob + bdbdd8744b35a0c889d8572b46ec471cd7d8d159 --- gotd/parse.y +++ gotd/parse.y @@ -195,6 +195,10 @@ conflags_l : conflags optnl conflags_l ; conflags : REQUEST TIMEOUT timeout { + if ($3.tv_sec <= 0) { + yyerror("invalid timeout: %lld", $3.tv_sec); + YYERROR; + } memcpy(&gotd->request_timeout, &$3, sizeof(gotd->request_timeout)); }