Commit 7da751d2 authored by Sandeep S. Shewalkar's avatar Sandeep S. Shewalkar
Browse files

Security Helper

following condition added to avoid exception
if (length - unpadding) <0
parent 58ebcdbc
Branches
1 merge request!37Security Helper
Showing with 4 additions and 0 deletions
......@@ -77,6 +77,10 @@ func AESDecrypt(encodedData, key []byte) ([]byte, error) {
unpadding := int(cipherText[length-1])
if (length - unpadding) < 0 {
return nil, errors.New("length of (length - unpadding) is less than 0")
}
return cipherText[:(length - unpadding)], nil
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment