emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C file recoginzed as image file


From: Richard Stallman
Subject: Re: C file recoginzed as image file
Date: Fri, 05 Jan 2007 21:55:10 -0500

    I don't want this situation to be possible in Emacs:

    I receive a file foo.c in an email, save it to disk and open it in
    Emacs, knowing that the .c type is opened in cc-mode which is safe.
    To my horror, the file actually contains an evil .jpg file which
    causes a buffer overflow in the jpg library; when it's displayed it
    infects my machine with a virus.

Compare that with this scenario:

    You receive a file foo.jpg in an email, you save it to disk
    and open it in Emacs, figuring that a jpg file ought to be safe.
    To your horror, the file actually contains an evil .jpg file which
    causes a buffer overflow in the jpg library; when it's displayed it
    infects your machine with a virus.

Assuming there is such a bug in the jpg library, the latter scenario
seems much more likely than the former.

Besides which, a jpg file starts with characters that don't make any
sense at the start of a C file.  So if it looks like a plausible C
file, it won't be treated as a jpeg.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]