I need to decode and then split the String to work with it. Until now, we use to:
byte[] decodedBytes = Base64.getDecoder().decode(stringToDecode);
String decodedString = new String(decodedBytes);
String timemillisToken = decodedString.split(c)[n];
Problem is that right now, fortify is asking us to avoid this, but I didnt find (or didnt understand) the answers I found for this problem.
“The call to String() on line nnn of SomeClass.java converts a byte array into a String, which may lead to data loss.”
We are sure that we are not going to loss data, so we thought about suppress it, but in another comment its saying:
“This can lead to data being lost, or a decrease in the level of security“
So we want to change if possible to avoid this warning.
Any tip? Thanks!