IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38666


Ignore:
Timestamp:
Aug 9, 2015, 6:43:40 AM (11 years ago)
Author:
eugene
Message:

catch buffer overruns for rice, avoid buffer overruns

Location:
branches/eam_branches/ipp-20150625/Ohana/src/libfits
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150625/Ohana/src/libfits/matrix/F_compress_data.c

    r38441 r38666  
    119119      return (FALSE);
    120120    }
     121    if (Nout > *Nzdata) {
     122      fprintf (stderr, "buffer overrun! %d out, %d available\n", Nout, *Nzdata);
     123      return FALSE;
     124    }
    121125    *Nzdata = Nout;
    122126    return TRUE;
  • branches/eam_branches/ipp-20150625/Ohana/src/libfits/table/F_compress_T.c

    r38553 r38666  
    211211
    212212  // allocate the intermediate storage buffers
    213   int Nzdata_alloc = max_width*ztilelen + 100;
     213  int Nzdata_alloc = 2*max_width*ztilelen + 100;
    214214  ALLOCATE (raw,   char, max_width*ztilelen);
    215215  ALLOCATE (zdata, char, Nzdata_alloc);
     
    223223  gettimeofday (&startTimer, (void *) NULL);
    224224
     225  // ohana_memcheck (TRUE);
     226
    225227  // compress the data : copy into a tile, compress the tile, then add to the output table
    226228  // each tile -> 1 row of the output table
     
    243245      }
    244246     
     247      // ohana_memcheck (TRUE);
     248
    245249      // XXX TIMER 2a
    246250      gettimeofday (&stopTimer, (void *) NULL);
     
    260264      }
    261265
     266      // ohana_memcheck (TRUE);
    262267      // optname, optvalue = NULL, Noptions = 0
    263268     
Note: See TracChangeset for help on using the changeset viewer.