https://bugzilla.novell.com/show_bug.cgi?id=679459
https://bugzilla.novell.com/show_bug.cgi?id=679459#c10
--- Comment #10 from Petr Gajdos 2011-03-21 09:09:46 UTC ---
I didn't test and I actually don't know why that bug hadn't arosen till now.
But the dangerous code is in all versions we support as far as I can tell.
infoSector->signature3 is unsigned char [2] (compare with ->signature1 and
->signature2), but set is with set_dword() -- like ->signature1 and
->signature2 are. Look at set_word() and set_dword() definitions in msdos.h for
details.
I propose following patch:
Index: mtools-4.0.15/fat.c
===================================================================
--- mtools-4.0.15.orig/fat.c
+++ mtools-4.0.15/fat.c
@@ -468,7 +468,7 @@ void fat_write(Fs_t *This)
set_dword(infoSector->signature2, INFOSECT_SIGNATURE2);
set_dword(infoSector->pos, This->last);
set_dword(infoSector->count, This->freeSpace);
- set_dword(infoSector->signature3, 0xaa55);
+ set_word(infoSector->signature3, 0xaa55);
if(forceWriteSector(This, (char *)infoSector,
This->infoSectorLoc, 1) !=
(signed int) This->sector_size)
fprintf(stderr,"Trouble writing the info sector\n");
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.