IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39476


Ignore:
Timestamp:
Mar 23, 2016, 12:28:49 PM (10 years ago)
Author:
eugene
Message:

handle case where incomplete message is returned

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/CheckController.c

    r36375 r39476  
    3333  /** find "Njobs: **/
    3434  p = memstr (buffer.buffer, "BEGIN BLOCK Njobs:", MIN(buffer.Nbuffer, 256));
     35  if (!p) goto escape;
     36
     37  // check if buffer has data after BEGIN BLOCK Njobs:
     38  if (buffer.Nbuffer - (p - buffer.buffer) < strlen("BEGIN BLOCK Njobs:")) goto escape;
     39
     40  // point to bit after Njobs:
    3541  p += strlen("BEGIN BLOCK Njobs:");
    3642
Note: See TracChangeset for help on using the changeset viewer.