mountmgr: Change scope of variable pvd in VOLUME_GetSuperblockLabel (cppcheck).

The data in pvd was being accessed through the label_ptr variable after
pvd went out of scope.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2021-12-19 21:54:21 -07:00 committed by Alexandre Julliard
parent 8e081d32bd
commit 656d7f58a1

View file

@ -398,6 +398,7 @@ static void VOLUME_GetSuperblockLabel( struct volume *volume, HANDLE handle, con
{
const BYTE *label_ptr = NULL;
DWORD label_len;
BYTE pvd[BLOCK_SIZE];
switch (volume->fs_type)
{
@ -435,9 +436,6 @@ static void VOLUME_GetSuperblockLabel( struct volume *volume, HANDLE handle, con
break;
}
case FS_UDF:
{
BYTE pvd[BLOCK_SIZE];
if(!UDF_Find_PVD(handle, pvd))
{
label_len = 0;
@ -462,7 +460,6 @@ static void VOLUME_GetSuperblockLabel( struct volume *volume, HANDLE handle, con
return;
}
}
}
if (label_len) RtlMultiByteToUnicodeN( volume->label, sizeof(volume->label) - sizeof(WCHAR),
&label_len, (const char *)label_ptr, label_len );
label_len /= sizeof(WCHAR);