Is this safe?
- if (NS_FAILED(ConvertFromUnicode(fileCharset, nsAutoString(aNewName), &convertedNewName))) + nsAutoString tmpAutoString; + tmpAutoString.AssignWithConversion(newSafeName); + if (NS_FAILED(ConvertFromUnicode(fileCharset, tmpAutoString, &convertedNewName)))
before your fix, we used aNewName, which was the PRUnichar * that they user typed in. (could have been the folder name, in chinese.)
now, we are converting newSafeName, which is going to be a hashed version that might be altered because of illegal chars or illegal length.
what do we do with convertedNewName after this?
Is this safe?
- ConvertFromUnic ode(fileCharset , nsAutoString( aNewName) , me))) AssignWithConve rsion(newSafeNa me); ConvertFromUnic ode(fileCharset , tmpAutoString, &convertedNewNa me)))
if (NS_FAILED(
&convertedNewNa
+ nsAutoString tmpAutoString;
+ tmpAutoString.
+ if (NS_FAILED(
before your fix, we used aNewName, which was the PRUnichar * that they user
typed in. (could have been the folder name, in chinese.)
now, we are converting newSafeName, which is going to be a hashed version that
might be altered because of illegal chars or illegal length.
what do we do with convertedNewName after this?