[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] PATCH: block-vvfat.c: fix parse_long_name
From: |
Tristan Gingold |
Subject: |
[Qemu-devel] PATCH: block-vvfat.c: fix parse_long_name |
Date: |
Wed, 2 Jul 2008 15:19:03 +0200 |
Hi,
if a long_file_name length is a multiple of 13, no NUL terminator is
appended to the internal name. As a
consequence garbled names can be written on the disk.
This patch makes sure a NUL terminator is always appended.
Tristan.
--- block-vvfat.c (revision 4820)
+++ block-vvfat.c (working copy)
@@ -1435,6 +1435,7 @@
lfn->sequence_number = pointer[0] & 0x3f;
lfn->checksum = pointer[13];
lfn->name[0] = 0;
+ lfn->name[lfn->sequence_number * 13] = 0;
} else if ((pointer[0] & 0x3f) != --lfn->sequence_number)
return -1;
else if (pointer[13] != lfn->checksum)
vvfat.diff
Description: Binary data
- [Qemu-devel] PATCH: block-vvfat.c: fix parse_long_name,
Tristan Gingold <=