- fixed program crash when normal mode parameers are missing in presentation layer (#252)

pull/265/head
Michael Zillgith 5 years ago
parent 9ab37e9836
commit 504c260667

@ -677,6 +677,7 @@ IsoPresentation_parseConnect(IsoPresentation* self, ByteBuffer* byteBuffer)
{
uint8_t* buffer = byteBuffer->buffer;
int maxBufPos = byteBuffer->size;
bool hasNormalModeParameters = false;
int bufPos = 0;
@ -745,6 +746,9 @@ IsoPresentation_parseConnect(IsoPresentation* self, ByteBuffer* byteBuffer)
printf("PRES: error parsing normal-mode-parameters\n");
return 0;
}
else {
hasNormalModeParameters = true;
}
break;
case 0x00: /* indefinite length end tag -> ignore */
@ -757,6 +761,13 @@ IsoPresentation_parseConnect(IsoPresentation* self, ByteBuffer* byteBuffer)
}
}
if (hasNormalModeParameters == false) {
if (DEBUG_PRES)
printf("PRES: error - normal mode parameters are missing\n");
return 0;
}
return 1;
}

Loading…
Cancel
Save