[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC: PATCH 3/5] Fix Length calculation in PdoQueryId
The 2nd chunk is cosmetic - keeping the order as the 1st chunk should help with clarity
Owen
[CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments unless you have verified the sender and know the content is safe.
On 31/08/2023 08:49, Owen Smith wrote:
> Decrease Length by the string length of the current ID before moving
> the Buffer value to the end of the current ID. Without this, Length
> is not decreased, leading to potential issues with the next call to
> RtlStringCbPrintfW.
>
> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxx>
> ---
> src/xenvif/pdo.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
> index 1d163c9..d43702e 100644
> --- a/src/xenvif/pdo.c
> +++ b/src/xenvif/pdo.c
> @@ -2100,11 +2100,11 @@ PdoQueryId(
> Revision->Number);
> ASSERT(NT_SUCCESS(status));
>
> - Buffer += wcslen(Buffer);
> Length -= (ULONG)(wcslen(Buffer) * sizeof (WCHAR));
> + Buffer += wcslen(Buffer);
This looks fine.
>
> - Buffer++;
> Length -= sizeof (WCHAR);
> + Buffer++;
This doesn't have any effect AFAICT though. Is it just a cosmetic change
to keep the updating of 'Buffer' and 'Length' in the same order?
Paul
>
> --Index;
> }
|