Ticket #47746

AI: dai_log_path() overflows

오픈 날짜: 2023-04-02 15:33 마지막 업데이트: 2023-04-15 06:48

Reporter:
소유자:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
1

Details

From https://osdn.net/projects/freeciv/ticket/46286#comment:12505:46286:1679918727 reported by alain_bkr:

1 ../../../ai/default/aitools.c:377:33: runtime error: signed integer overflow
5 ../../../ai/default/aitools.c:378:18: runtime error: signed integer overflow
1 ../../../ai/default/aitools.c:378:41: runtime error: signed integer overflow

Those are in dai_log_path()

Ticket History (3/4 Histories)

2023-04-02 15:33 Updated by: cazfi
  • New Ticket "AI: dai_log_path() overflows" created
2023-04-08 22:53 Updated by: cazfi
  • 소유자 Update from (None) to cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.0.8 (closed)
댓글 올리기

Attached patch makes those cost values unsigned. This is unlikely enough to resolve all cases where the overflow occurs, but should at least reduce their number.

(Maybe new tickets about moving the function to ailog.c, and another about not calculating those values at all when actual logging is not taking place)

2023-04-15 06:48 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login