Commit Diff


commit - 1bf5a5748b2967355ebe0d31bf47e53b5f63ad14
commit + 12e4b84cd4a8ccc7ff8312f31d3bcc13d1f0de33
blob - 9828b17dceba9daaa0db392d31bde067fe8c2c83
blob + 8c7194c1789506c5346a4eb82edb88125e9a1d87
--- FICS/obsproc.c
+++ FICS/obsproc.c
@@ -1003,7 +1003,7 @@ FindHistory(int p, int p1, int p_game)
 
 	fclose(fpHist);
 
-	if (when < 0) {
+	if (when < 0 || when >= LONG_MAX) {
 		pprintf(p, "Corrupt history data for %s (invalid timestamp).\n",
 		    parray[p1].name);
 		return NULL;
@@ -1054,7 +1054,7 @@ FindHistory2(int p, int p1, int p_game, char *End, con
 
 	fclose(fpHist);
 
-	if (when < 0) {
+	if (when < 0 || when >= LONG_MAX) {
 		pprintf(p, "Invalid history timestamp for %s.\n",
 		    parray[p1].name);
 		return NULL;