After reviewing the code that provides the password from AMT to the connection manager, in a later revision after this line was added, the password is assigned a null terminator in its conversion. Meaning, these lines are no longer necessary.
I will update the patch and resend for submission. Please feel free to review the rest of this patch in the mean time and provide feedback of any other misalignments to be changed. Thanks, Zack -----Original Message----- From: Michael Brown <mc...@ipxe.org> Sent: Monday, September 26, 2022 9:27 AM To: devel@edk2.groups.io; Clark-williams, Zachary <zachary.clark-willi...@intel.com>; Luo, Heng <heng....@intel.com> Cc: Zachary Clark-Williams <zclarkw...@gmail.com>; Maciej Rabeda <maciej.rab...@linux.intel.com> Subject: Re: [edk2-devel] [PATCH] NetworkPkg: Add WiFi profile sync protocol support 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 (#94354): https://edk2.groups.io/g/devel/message/94354 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] -=-=-=-=-=-=-=-=-=-=-=-