IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40816


Ignore:
Timestamp:
Jun 22, 2019, 3:32:40 PM (7 years ago)
Author:
eugene
Message:

squash possible memory corruption error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/opihi/lib.shell/multicommand.c

    r40776 r40816  
    6363
    6464  p = line;
     65  int Nline = strlen(line);
     66 
    6567  done = FALSE;
    6668  status = TRUE;
     
    7476    tmpline = strncreate (p, q - p);
    7577    stripwhite (tmpline);
     78    myAssert (tmpline, "oops");
    7679
    7780    // empty command, free and continue
    7881    if (*tmpline == 0) {
    7982      free (tmpline);
    80       p = q + 1;
     83      if (q == line + Nline) {
     84        done = TRUE;
     85      } else {
     86        p = q + 1;
     87        myAssert (p - line <= Nline, "oops");
     88      }
    8189      continue;
    8290    }
Note: See TracChangeset for help on using the changeset viewer.