待辦事項 #20618

terrain_table配列範囲外参照

啟用日期: 2010-02-11 23:25 最後更新: 2020-12-20 21:48

回報者:
負責人:
類型:
狀態:
關閉
元件:
(無)
優先權:
3
嚴重程度:
3
處理結果:
修正
檔案:

細節

wild.cのinit_terrain_table関数にて、terrain_table配列の範囲外を参照することがあります。 以下は修正パッチです。

diff -ur src_org/wild.c src/wild.c
--- src_org/wild.c	Thu Feb 11 14:00:58 2010
+++ src/wild.c	Thu Feb 11 23:02:00 2010
@@ -926,8 +926,11 @@
 		}
 	}
 
-	feat = terrain_table[terrain][cur];
-	for (; cur < MAX_FEAT_IN_TERRAIN; cur++) terrain_table[terrain][cur] = feat;
+	/* Paranoia */
+	if (cur < MAX_FEAT_IN_TERRAIN)
+	{
+		plog_fmt("Too few parameters");
+	}
 
 	/* End the varargs stuff */
 	va_end(vp);

Ticket History (3/3 Histories)

2010-02-11 23:25 Updated by: shimitei
  • New Ticket "terrain_table配列範囲外参照" created
2010-02-13 00:36 Updated by: habu
  • 狀態 Update from 開啟 to 關閉
  • Ticket Close date is changed to 2010-02-13 00:36
評語

パッチそのまま頂きました。r3077で修正。

2020-12-20 21:48 Updated by: deskull

Attachment File List

No attachments

編輯

Please login to add comment to this ticket » 登入