lfnetwork.com mark read register faq members calendar

Thread: basejk bug. will over write varables
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 06-24-2004, 10:35 PM   #1
orion2486
 
orion2486's Avatar
 
Join Date: Mar 2003
Posts: 5
basejk bug. will over write varables

wondering if anyone found this base jk bug, this is in both jk2 and jk3

in g_local.h

Quote:
int numTeamVotingClients[2]; // set by CalculateRanks
in bg_public.h
Quote:
enum {
TEAM_FREE,
TEAM_RED,
TEAM_BLUE,
TEAM_SPECTATOR,

TEAM_NUM_TEAMS
};
in g_main.c, Function CalculateRanks()

Quote:
for (i = 0; i < TEAM_NUM_TEAMS; i++) {
level.numteamVotingClients[i] = 0;
}

While i was doing bug fixing for JAR 1.4. Getting ready for release, finally. I had right after the declartion of the numteamVotingClients some team locking bools, and i would notice that those bools would randomly get reset to qfalse. taht being the above for loop, loops 4 times while the array is two, thus going out of bounds and overwriting whatever is in the next 8 bytes of memory to zero. I've corrected this for JAR and for the next version of JA Mod, and if anyone else hasn't seen this error here you go. Ive done testing and you can either change the for loop to only execute 2 times, since any instance of that variable is only indexed at 0 and 1, or just make the array a size of 4.
orion2486 is offline   you may: quote & reply,
Old 06-30-2004, 06:42 AM   #2
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,162
hmmm, interesting. I wasn't aware that you could do that. Thanks for the heads up. I've added this to OJP.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > basejk bug. will over write varables

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:11 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.