public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Brown" <mcb30@ipxe.org>
To: devel@edk2.groups.io, zachary.clark-williams@intel.com, "Luo,
	Heng" <heng.luo@intel.com>
Cc: Zachary Clark-Williams <zclarkw112@gmail.com>,
	Maciej Rabeda <maciej.rabeda@linux.intel.com>
Subject: Re: [edk2-devel] [PATCH] NetworkPkg: Add WiFi profile sync protocol support
Date: Mon, 26 Sep 2022 17:27:24 +0100	[thread overview]
Message-ID: <afc9ae7c-f2fb-132a-136c-7fa45ce1f20f@ipxe.org> (raw)
In-Reply-To: <CO6PR11MB560115D08124E22E751C5A26C9529@CO6PR11MB5601.namprd11.prod.outlook.com>

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

  reply	other threads:[~2022-09-26 17:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 19:42 [PATCH] NetworkPkg: Add WiFi profile sync protocol support Clark-williams, Zachary
2022-09-26  7:37 ` [edk2-devel] " Heng Luo
2022-09-26 15:39   ` Clark-williams, Zachary
2022-09-26 16:27     ` Michael Brown [this message]
2022-09-26 17:39       ` Clark-williams, Zachary
  -- strict thread matches above, loose matches on Subject: below --
2023-01-07  1:31 Clark-williams, Zachary
2023-01-10  3:02 ` Wu, Jiaxin
2023-01-10  5:27   ` [edk2-devel] " Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afc9ae7c-f2fb-132a-136c-7fa45ce1f20f@ipxe.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox