URL:
http://gna.org/bugs/?19005
Summary: calloc can overflow
Project: Freeciv
Submitted by: akfaew
Submitted on: Wed Nov 16 08:54:10 2011
Category: None
Severity: 3 - Normal
Priority: 5 -
Follow-up Comment #1, bug #19005 (project freeciv):
I'm not familiar with the memory management but you should also add the
checks in line 1384 1385 to the patch. Else it will not help at all ...
___
Reply to this item at:
Follow-up Comment #2, bug #19005 (project freeciv):
fc_real_malloc will handle that, it calls sanity_check_size. Calloc only
cares about overflow. The SIZE_MAX part is redundant I think, it is equivalent
to SIZE_MAX nmemb * size. It can be important on some strange platforms, but
on both Intel