Xref: utzoo comp.sources.bugs:1390 comp.bugs.sys5:695 Path: utzoo!attcan!uunet!pyrdc!pyrnj!rutgers!columbia!douglass!dupuy From: dupuy@douglass.columbia.edu (Alexander Dupuy) Newsgroups: comp.sources.bugs,comp.bugs.sys5 Subject: Re: v05i028: /etc/magic lines for compress Summary: you can crash file with misaligned magic Message-ID: <6029@columbia.edu> Date: 17 Nov 88 18:53:42 GMT References: <1033@investor.UUCP> <454@auspex.UUCP> <7714@boring.cwi.nl> <6021@columbia.edu> Sender: news@columbia.edu Reply-To: dupuy@douglass.columbia.edu (Alexander Dupuy) Followup-To: comp.sources.bugs Organization: Columbia University Computer Science Dept. Lines: 17 Just to follow up on the problems with /etc/magic formats: it is currently possible to cause file(1) to crash on a Sparc (or other strict alignment machine) by having magic entries which are of type "short" or "long", at misaligned offsets. If you have a Sun-2 or Sun-4, you can repeat this by placing the following entry into /etc/magic: 1 long 0 doesn't matter if it matches or not. This should crash file with a Bus Error, when you apply it to any file for which it doesn't have a builtin rule, such as an ordinary ASCII text file. @alex -- inet: dupuy@columbia.edu uucp: ...!rutgers!columbia!dupuy