Commit 64eaabda73382b5b826dcd426200edc7c6c47d8b

Authored by ths
1 parent 8c5e95d8

Clarified filename handling, by Johannes Schindelin.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4842 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 1 deletions
block-vvfat.c
@@ -1410,7 +1410,12 @@ static void schedule_mkdir(BDRVVVFATState* s, uint32_t cluster, char* path) @@ -1410,7 +1410,12 @@ static void schedule_mkdir(BDRVVVFATState* s, uint32_t cluster, char* path)
1410 } 1410 }
1411 1411
1412 typedef struct { 1412 typedef struct {
1413 - unsigned char name[1024]; 1413 + /*
  1414 + * Since the sequence number is at most 0x3f, and the filename
  1415 + * length is at most 13 times the sequence number, the maximal
  1416 + * filename length is 0x3f * 13 bytes.
  1417 + */
  1418 + unsigned char name[0x3f * 13 + 1];
1414 int checksum, len; 1419 int checksum, len;
1415 int sequence_number; 1420 int sequence_number;
1416 } long_file_name; 1421 } long_file_name;