infomaniac50 / dokan

Automatically exported from code.google.com/p/dokan
0 stars 1 forks source link

bug when setting the value of Vpb->VolumeLabel #161

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/dokan/source/browse/trunk/sys/init.c#562

check code

{{{
RtlStringCchCopyW(diskDeviceObject->Vpb->VolumeLabel, 
sizeof(diskDeviceObject->Vpb->VolumeLabel) / sizeof(WCHAR), VOLUME_LABEL);
}}}

I think you need to replace the code. Something like

{{{
diskDeviceObject->Vpb->VolumeLabel = ExAllocatePool(diskDeviceObject->Vpb-
>VolumeLabelLength);
RtlStringCchCopyW(diskDeviceObject->Vpb->VolumeLabel, diskDeviceObject-
>Vpb->VolumeLabelLength / sizeof(WCHAR), VOLUME_LABEL);
}}}

or

{{{
diskDeviceObject->Vpb->VolumeLabel = ExAllocatePool(diskDeviceObject->Vpb-
>VolumeLabelLength);
RtlStringCchCopyW(diskDeviceObject->Vpb->VolumeLabel, sizeof(VOLUME_LABEL) 
/ sizeof(WCHAR), VOLUME_LABEL);
}}}

or read-only

{{{
vpb->VolumeLabelLength = sizeof(VOLUME_LABEL);
vpb->VolumeLabel = VOLUME_LABEL;
}}}

here is the same
http://code.google.com/p/dokan/source/browse/trunk/sys/fscontrol.c#328

Original issue reported on code.google.com by xxxel...@gmail.com on 28 May 2010 at 6:08

GoogleCodeExporter commented 9 years ago
I looked up the definition of VPB. I was mistaken. Sorry.

Original comment by xxxel...@gmail.com on 30 May 2010 at 4:24

GoogleCodeExporter commented 9 years ago
No problem, thank you for your report. If you find another issue, please free 
to post. 

Original comment by asa...@gmail.com on 7 Jan 2011 at 4:17