diff options
Diffstat (limited to 'dumpstate')
-rwxr-xr-x | dumpstate/DumpstateDevice.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 6e882a9..bc43a6d 100755 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -196,6 +196,9 @@ static void ProcessPcapDump(FILE *fp, pcap_dumper_t *dumper) char* strTmpTime = arrStrTime; struct pcap_pkthdr pcap_hdr; while ((strTime = strtok_r(strTmpTime, ".", &strTmpTime))) { + if(strTmpTime == NULL) { + break; + } time_t time; struct tm timeStruct; memset(&timeStruct, 0, sizeof(struct tm)); @@ -205,6 +208,9 @@ static void ProcessPcapDump(FILE *fp, pcap_dumper_t *dumper) pcap_hdr.ts.tv_sec = time; } strTimeMsec = strtok_r(strTmpTime, ".", &strTmpTime); + if(strTimeMsec == NULL) { + break; + } timeMSec = atoi(strTimeMsec); pcap_hdr.ts.tv_usec = timeMSec; } |