return ERROR_INTERNAL_ERROR;
}
- if (Stream_GetRemainingLength(s) < 28)
+ if (Stream_GetRemainingLength(s) < 24)
{
- WLog_ERR(TAG, "not enought remaining data");
+ WLog_ERR(TAG, "not enough remaining data");
return ERROR_INVALID_DATA;
}
Stream_Read_UINT32(s, request.nPositionLow); /* nPositionLow (4 bytes) */
Stream_Read_UINT32(s, request.nPositionHigh); /* nPositionHigh (4 bytes) */
Stream_Read_UINT32(s, request.cbRequested); /* cbRequested (4 bytes) */
- Stream_Read_UINT32(s, request.clipDataId); /* clipDataId (4 bytes) */
+ if (Stream_GetRemainingLength(s) >= 4)
+ Stream_Read_UINT32(s, request.clipDataId); /* clipDataId (4 bytes) */
+ else
+ request.clipDataId = 0;
IFCALLRET(context->ServerFileContentsRequest, error, context, &request);
if (Stream_GetRemainingLength(s) < 4)
{
- WLog_ERR(TAG, "not enought remaining data");
+ WLog_ERR(TAG, "not enough remaining data");
return ERROR_INVALID_DATA;
}
if (Stream_GetRemainingLength(s) < 4)
{
- WLog_ERR(TAG, "not enought remaining data");
+ WLog_ERR(TAG, "not enough remaining data");
return ERROR_INVALID_DATA;
}
if (Stream_GetRemainingLength(s) < 4)
{
- WLog_ERR(TAG, "not enought remaining data");
+ WLog_ERR(TAG, "not enough remaining data");
return ERROR_INVALID_DATA;
}
if (Stream_GetRemainingLength(s) < 4)
{
- WLog_ERR(TAG, "not enought data in stream!");
+ WLog_ERR(TAG, "not enough data in stream!");
return ERROR_INVALID_DATA;
}
if (Stream_GetRemainingLength(s) < 4)
{
- WLog_ERR(TAG, "not enought data in stream!");
+ WLog_ERR(TAG, "not enough data in stream!");
return ERROR_INVALID_DATA;
}
if (Stream_GetRemainingLength(s) < 4)
{
- WLog_ERR(TAG, "not enought data in stream!");
+ WLog_ERR(TAG, "not enough data in stream!");
return ERROR_INVALID_DATA;
}
if (Stream_GetRemainingLength(s) < header->dataLen)
{
- WLog_ERR(TAG, "not enought data in stream!");
+ WLog_ERR(TAG, "not enough data in stream!");
return ERROR_INVALID_DATA;
}
if (Stream_GetRemainingLength(s) < 24)
{
- WLog_ERR(TAG, "not enought data in stream!");
+ WLog_ERR(TAG, "not enough data in stream!");
return ERROR_INVALID_DATA;
}
if (Stream_GetRemainingLength(s) < 4)
{
- WLog_ERR(TAG, "not enought data in stream!");
+ WLog_ERR(TAG, "not enough data in stream!");
return ERROR_INVALID_DATA;
}