User Tag List

Results 1 to 8 of 8

Thread: VenRob as Proper Dev

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,960
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.34%
    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.

  2. #2
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,764
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.56%
    Quote Originally Posted by Gleeok View Post
    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?
    Oh dear, it looks like that one is indeed missing a sanity bound. It should have two, in fact.

    Specifically, it needs this:

    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;
    }
    One of these days I'll add some more boundscheck inline functions for this sort of thing.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social