On 26/09/2022 16:39, Clark-williams, Zachary wrote:
+ if (Profile->Password[StrLen (Profile->Password)] != '\0') {
+ Profile->Password[StrLen (Profile->Password)] = L'\0'; }
+
I don't understand this change, StrLen returns the length of a Null-terminated Unicode string,
it means "Profile->Password[StrLen (Profile->Password)]" should always be 0.
Did you see exceptional case?
Yes this is checking if the users entered password had a terminator on the end,
if it doesn't we are adding it.
During dev and testing we found a failure case if this was not tested and fixed.
No. StrLen() works by scanning the string until it finds a L'\0'
terminator. Your code is provably wrong.
I would suggest that you retest, and find the mistake in your testing
process.
Michael
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94353): https://edk2.groups.io/g/devel/message/94353
Mute This Topic: https://groups.io/mt/93685737/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-