]> granicus.if.org Git - file/commitdiff
Harden magic to fix regression:
authorChristos Zoulas <christos@zoulas.com>
Tue, 8 Nov 2016 23:52:10 +0000 (23:52 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 8 Nov 2016 23:52:10 +0000 (23:52 +0000)
An old WordPerfect4 files got mis-detected as :
"DOS 2.0 backed up file \313\300, split file, sequence 266"
(Christoph Biedl)

magic/Magdir/msdos

index b73477046fcabfbc08a05101e776f1236ffe1636..7bc269a37ae13c442686e216137d7141119fba26 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: msdos,v 1.113 2016/11/07 15:37:29 christos Exp $
+# $File: msdos,v 1.114 2016/11/08 23:52:10 christos Exp $
 # msdos:  file(1) magic for MS-DOS files
 #
 
 # backed up file
 
 # plausibility check for file name length
-0x53   ubyte   <79
+0x53   ubyte-1 <80
 # actually 54 nul bytes
->0x54  string  \0\0\0\0\0\0\0\0
+>0x54  string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
 >>0x5  string  x       DOS 2.0 backed up file %s,
 >>0    ubyte   0xff    complete file
 >>0    ubyte   !0xff