URL:
<http://gna.org/patch/?4402>
Summary: Fix typo that allowed custom formats only up to
sizeof(char*)
Project: Freeciv
Submitted by: silene
Submitted on: Fri 03 Jan 2014 01:22:58 PM CET
Category: general
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release:
_______________________________________________________
Details:
A new version of Clang was uploaded to Debian, which means support for some
new warnings appeared, and a bug showed up in utility/shared.c:fc_vsnprintcf
(used to create savegames).
Due to a typo, the internal buffer was undersized from 30 bytes to
sizeof(char*). As a consequence, on 32-bit architectures, any format
descriptor larger than 4 + 1 bytes would have failed. By sheer luck, the
largest descriptor in Freeciv is currently 5-byte long, so the bug went
unnoticed.
This part of the code has not changed for almost 4 years, so the patch should
apply cleanly to all versions.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 03 Jan 2014 01:22:58 PM CET Name: vsnprintcf.patch Size: 687B
By: silene
<http://gna.org/patch/download.php?file_id=19634>
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?4402>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev