Well, maybe I am hallucinating or something, but what's to stop refInfo.d[] from being less than 1...?
m->initd[(ri->d[0]/10000) - 1][(ri->d[1]/10000)] = value;
Is this valid?
Well, maybe I am hallucinating or something, but what's to stop refInfo.d[] from being less than 1...?
m->initd[(ri->d[0]/10000) - 1][(ri->d[1]/10000)] = value;
Is this valid?
This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.
Oh dear, it looks like that one is indeed missing a sanity bound. It should have two, in fact.
Specifically, it needs this:
One of these days I'll add some more boundscheck inline functions for this sort of thing.Code:int ffid = (ri->d[0]/10000)-1; int indx = ri->d[1]/10000; if ( ffid < 0 || ffid > 31 ) { Z_scripterrlog("Invalid FFC id passed to mapdata->FFCInitD[]: %d",ffid); } else if ( indx < 0 || indx > 7 ) { Z_scripterrlog("Invalid InitD[] index passed to mapdata->FFCInitD[]: %d",indx); } else { m->initd[ffid][(ri->d[indx] = value; }
Last edited by ZoriaRPG; 11-03-2018 at 01:53 PM.
http://www.zoriarpg.com/zc/LoE_Userbar.png http://zoriarpg.com/zc/EiyuuUserbar.png
http://www.zoriarpg.com/zc/CIS_Original.pnghttp://www.zoriarpg.com/zc/CIS_II_Userbar.png
Latest ZC 2.53 (Win32) | (Technical Specification | Changelog)
Latest ZC 2.55(Win32) | 2.55 Modules | (Techical Specification | Changelog)
ZC Source Code | ZClaunch Source Code
Featured Scripts & Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | Zelda 3 Thief's Town Treasure Chest Minigame (ffc) | Bobomb (enemy)
ZScript & ZC-Related Pastebin | ZC Dev & Builds | ARCHIVED ZC Dev & Builds | YouTube Channel | Quests and ZScript Repository
All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0, or v3.0 where applicable.
There are currently 1 users browsing this thread. (0 members and 1 guests)