Commit Diff


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