commit 46e48ac738ef3d714f4258bd513bca84369a457d from: Stefan Sperling date: Tue Jan 03 14:16:30 2023 UTC enforce gotd request timeout > 0; the code doesn't handle zero right now spotted by + ok op@ commit - 1b18f4cd75fddf070589d9b045e083ac02d8baba commit + 46e48ac738ef3d714f4258bd513bca84369a457d 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)); }