mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 09:15:11 +00:00
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:
parent
8e081d32bd
commit
656d7f58a1
|
@ -398,6 +398,7 @@ static void VOLUME_GetSuperblockLabel( struct volume *volume, HANDLE handle, con
|
||||||
{
|
{
|
||||||
const BYTE *label_ptr = NULL;
|
const BYTE *label_ptr = NULL;
|
||||||
DWORD label_len;
|
DWORD label_len;
|
||||||
|
BYTE pvd[BLOCK_SIZE];
|
||||||
|
|
||||||
switch (volume->fs_type)
|
switch (volume->fs_type)
|
||||||
{
|
{
|
||||||
|
@ -435,32 +436,28 @@ static void VOLUME_GetSuperblockLabel( struct volume *volume, HANDLE handle, con
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FS_UDF:
|
case FS_UDF:
|
||||||
|
if(!UDF_Find_PVD(handle, pvd))
|
||||||
{
|
{
|
||||||
BYTE pvd[BLOCK_SIZE];
|
label_len = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if(!UDF_Find_PVD(handle, pvd))
|
/* [E] 3/10.1.4 and [U] 2.1.1 */
|
||||||
{
|
if(pvd[24]==8)
|
||||||
label_len = 0;
|
{
|
||||||
break;
|
label_ptr = pvd + 24 + 1;
|
||||||
}
|
label_len = pvd[24+32-1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
/* [E] 3/10.1.4 and [U] 2.1.1 */
|
label_len = 1 + pvd[24+32-1];
|
||||||
if(pvd[24]==8)
|
for (i = 0; i < label_len; i += 2)
|
||||||
{
|
volume->label[i/2] = (pvd[24+1+i] << 8) | pvd[24+1+i+1];
|
||||||
label_ptr = pvd + 24 + 1;
|
volume->label[label_len] = 0;
|
||||||
label_len = pvd[24+32-1];
|
return;
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
label_len = 1 + pvd[24+32-1];
|
|
||||||
for (i = 0; i < label_len; i += 2)
|
|
||||||
volume->label[i/2] = (pvd[24+1+i] << 8) | pvd[24+1+i+1];
|
|
||||||
volume->label[label_len] = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (label_len) RtlMultiByteToUnicodeN( volume->label, sizeof(volume->label) - sizeof(WCHAR),
|
if (label_len) RtlMultiByteToUnicodeN( volume->label, sizeof(volume->label) - sizeof(WCHAR),
|
||||||
|
|
Loading…
Reference in a new issue