Skip to content
Permalink
Browse files

Add checks for string sizes

  • Loading branch information...
peak3d committed Feb 8, 2019
1 parent 06cf64f commit f782dcc44dd46f896c2ffb14083379bdf244bc28
Showing with 3 additions and 3 deletions.
  1. +1 −1 wvdecrypter/wvdecrypter.cpp
  2. +1 −1 wvdecrypter/wvdecrypter_android.cpp
  3. +1 −1 wvdecrypter/wvdecrypter_android_jni.cpp
@@ -880,7 +880,7 @@ bool WV_CencSingleSampleDecrypter::SendSessionMessage()

if (!blocks[3].empty() && !serverCertRequest)
{
if (blocks[3][0] == 'J' || (blocks[3][0] == 'B' && blocks[3][1] == 'J'))
if (blocks[3][0] == 'J' || (blocks[3].size() > 1 && blocks[3][0] == 'B' && blocks[3][1] == 'J'))
{
int dataPos = 2;

@@ -683,7 +683,7 @@ bool WV_CencSingleSampleDecrypter::SendSessionMessage(AMediaDrmByteArray &sessio

if (!blocks[3].empty())
{
if (blocks[3][0] == 'J' || (blocks[3][0] == 'B' && blocks[3][1] == 'J'))
if (blocks[3][0] == 'J' || ((blocks[3].size() > 1 && blocks[3][0] == 'B' && blocks[3][1] == 'J'))
{
int dataPos = 2;

@@ -784,7 +784,7 @@ bool WV_CencSingleSampleDecrypter::SendSessionMessage(const std::vector<char> &k

if (!blocks[3].empty() && (keyRequestData.size() > 2 || contentType.find("application/octet-stream") == std::string::npos))
{
if (blocks[3][0] == 'J' || (blocks[3][0] == 'B' && blocks[3][1] == 'J'))
if (blocks[3][0] == 'J' || (blocks[3].size() > 1 && blocks[3][0] == 'B' && blocks[3][1] == 'J'))
{
int dataPos = 2;

0 comments on commit f782dcc

Please sign in to comment.
You can’t perform that action at this time.