Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] Re: (PR#3706) append the capstring
Home

[Freeciv-Dev] Re: (PR#3706) append the capstring

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3706) append the capstring
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 21 Mar 2003 15:51:38 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Mike Kaufman wrote:
> On Fri, Mar 21, 2003 at 03:11:57PM -0800, Jason Short wrote:
> 
>>Actually, I think that
>>
>>(1) We need to more rigorously check the capstring length, particularly 
>>in init_our_capability().  One of these days (probably before the next 
>>release :-) we will overrun MAX_LEN_CAPSTR - and when we do it would be 
>>nice if things didn't just *silently* break.
>>
>>(2) append_capability shouldn't export the problem by returning a 
>>boolean.  If the capstring does overflow it's because of a bug (that 
>>will affect everyone), and should be fixed (probably just by upping the 
>>protocol version #).
> 
> 
> I can see that you didn't actually test this. This won't work cause die
> requires freelog which hasn't been inited yet... this is why I exported the
> 'problem'.

Indeed.

I still believe the above two things, though.  It is easy to use printf 
instead of freelog.

Also, I note that passing a very long FREECIV_CAPSTR (or whatever) 
environment variable can trigger the die() call.  Which means it 
shouldn't be a die anyway (this is reserved for code errors).

Sigh...

jason




[Prev in Thread] Current Thread [Next in Thread]