IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39599 for trunk


Ignore:
Timestamp:
Jun 12, 2016, 10:20:48 AM (10 years ago)
Author:
eugene
Message:

avoid a segfault if create vector range is negative

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/create.c

    r28335 r39599  
    2626  if (argc == 5) delta = atof (argv[4]);
    2727
    28   if ((start == end) || (delta == 0)) {
     28  if (!isfinite(start) || !isfinite(end) || (start == end) || (delta == 0)) {
    2929    gprint (GP_ERR, "error in value: %f to %f, %f\n", start, end, delta);
    3030    return (FALSE);
     
    4040  }
    4141
    42   vec[0].Nelements = (end - start) / delta;
     42  vec[0].Nelements = MAX(0, (end - start) / delta);
    4343
    4444  if (INT) {
Note: See TracChangeset for help on using the changeset viewer.