forked from wolfSSL/wolfssl
don't set GetLength input value to negative in error case, shouldn't matter if return value checked
This commit is contained in:
@@ -424,6 +424,8 @@ CYASSL_LOCAL int GetLength(const byte* input, word32* inOutIdx, int* len,
|
|||||||
word32 i = *inOutIdx;
|
word32 i = *inOutIdx;
|
||||||
byte b;
|
byte b;
|
||||||
|
|
||||||
|
*len = 0; /* default length */
|
||||||
|
|
||||||
if ( (i+1) > maxIdx) { /* for first read */
|
if ( (i+1) > maxIdx) { /* for first read */
|
||||||
CYASSL_MSG("GetLength bad index on input");
|
CYASSL_MSG("GetLength bad index on input");
|
||||||
return BUFFER_E;
|
return BUFFER_E;
|
||||||
@@ -452,7 +454,8 @@ CYASSL_LOCAL int GetLength(const byte* input, word32* inOutIdx, int* len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*inOutIdx = i;
|
*inOutIdx = i;
|
||||||
*len = length;
|
if (length > 0)
|
||||||
|
*len = length;
|
||||||
|
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user