Commit Diff
--- 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)); }