Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2000:
[Freeciv-Dev] patch: safer string handling: client (PR#221)
Home

[Freeciv-Dev] patch: safer string handling: client (PR#221)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] patch: safer string handling: client (PR#221)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sat, 1 Jan 2000 01:03:44 -0800 (PST)

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

Attachment: 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 <=