[Freeciv-Dev] patch: safer string handling: client (PR#221)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Another mostly straightforward but tedious (and large) patch
to do safer string operations, this time for client/*.c,
client/gui-{xaw,gtk}/*.c. (Didn't do gui-mui, except some
changed function prototypes, because without being able to
compile would be sure to make mistakes.)
Similar comments apply as patches for common/ and server/.
(Requires sz_strl{cpy,cat} from previous post PR#219.)
Alot of helpdata.c and gui-*/helpdlg.c need more extensive
changes to check buffer lengths, which I have not done here.
Notable changes:
- Added a buffer length argument to some functions which write
into user-supplied buffers, to allow checking lengths.
- Added bounds check for packet->id in handle_ruleset_city().
Minor code fix: do not need ';' after 'if' blocks! (not related to
string ops, except I noticed a few while doing nearby changes).
General observations:
- append_output_window() should be printf-like...
- Some global vars in civclient.c should be tidied up -- eg, put in
civclient.h, with accessible buffer lengths. (Also, "name" is not
a good name for a global variable...)
-- David
safe_str_client.diff.gz
Description: GNU Zip compressed data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] patch: safer string handling: client (PR#221),
David Pfitzner <=
|
|