Complete.Org: Mailing Lists: Archives: freeciv-ai: December 2002:
[freeciv-ai] Re: [Freeciv-Dev] Re: (PR#2518) ai reading from raw memory?
Home

[freeciv-ai] Re: [Freeciv-Dev] Re: (PR#2518) ai reading from raw memory?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: [Freeciv-Dev] Re: (PR#2518) ai reading from raw memory?
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 9 Dec 2002 11:56:23 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, Dec 09, 2002 at 11:32:16AM -0800, Per I. Mathisen via RT wrote:
> 
> On Mon, 9 Dec 2002, Raimar Falke via RT wrote:
> > > Arrgh - the ai_choice mess is even in the server directory! Use this patch
> > > instead, it should cover all cases.
> >
> > You missed the one I reported:
> >
> > ==25366== Conditional jump or move depends on uninitialised value(s)
> > ==25366==  at 0x80D49FD: copy_if_better_choice (aitools.c:451)
> > ==25366==  by 0x80D39C8: ai_next_tech_goal (aitech.c:247)
> > ==25366==  by 0x8084920: choose_goal_tech (plrhand.c:433)
> > ==25366==  by 0x8084238: found_new_tech (plrhand.c:274)
> 
> As far as I can see, the bug isn't in that function, but we're sending
> this function pointers to uninitialized data. And this my patch should
> fix. No?

The patch should also change
void ai_next_tech_goal(struct player *pplayer)
{
  struct ai_choice bestchoice, curchoice;

  bestchoice.choice = A_NONE;
  bestchoice.want   = 0;

into

void ai_next_tech_goal(struct player *pplayer)
{
  struct ai_choice bestchoice, curchoice;

  init_choice(&bestchoice);

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Are you saying that you actually used the Classpath Java AWT classes in 
  addition to the GTK peers and got them to display something?
  Wow.  That's way better than I did and I wrote the code!"
    -- Aaron M. Renn in the classpath mailing list




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