unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Richard M. Stallman" <rms@gnu.org>
Cc: romain@orebokech.com, emacs-devel@gnu.org
Subject: Re: image size limit?
Date: Sun, 16 Oct 2005 13:36:41 -0400	[thread overview]
Message-ID: <E1ERCR7-0002Lh-47@fencepost.gnu.org> (raw)
In-Reply-To: <87oe5qiq96.fsf@stupidchicken.com> (message from Chong Yidong on Sat, 15 Oct 2005 14:33:57 -0400)

    As for libpng, the png_set_user_limits() function was only added in
    version 1.0.16rc1, from 2004, so if we use that we'll lose
    compatibility with older versions.

I think it is ok for the new Emacs to use a feature of libpng that
is one year old.  Would you like to write the code?

Perhaps configure should verify that that entry point exists, and
call it only if it is available.

    >     At the same time, we implement image width and height limits in
    >     x_create_x_image_and_pixmap, to deal with malicious images that
    >     specify gigantic width and height sizes, even though the file size
    >     isn't that big.
    >
    > Will that succeed in handling the problem case we got?

    It will avoid allocating too much memory in Emacs.  Whether libungif
    tries to allocate too much memory prior to this, depends on the
    internal implementation of libungif.  Worst that could happen is that
    libungif believes the invalid width and height data, tries to malloc a
    big chunk of memory, malloc fails, and DGifSlurp() frees the memory
    and returns with an error, which we catch.

I am not sure that is the worst that can happen, but if it does happen,
I agree it is better than what happens now.  So would you like to implement
that?

  reply	other threads:[~2005-10-16 17:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-11 20:32 image size limit? Chong Yidong
2005-10-11 21:19 ` Kevin Rodgers
2005-10-12 16:24 ` Richard M. Stallman
2005-10-12 17:40   ` Romain Francoise
2005-10-13 20:13     ` Richard M. Stallman
2005-10-14 13:02       ` Chong Yidong
2005-10-15 16:13         ` Richard M. Stallman
2005-10-15 18:33           ` Chong Yidong
2005-10-16 17:36             ` Richard M. Stallman [this message]
2005-10-16 22:27       ` Chong Yidong
2005-10-17 17:30         ` Richard M. Stallman
2005-10-17 21:56           ` Chong Yidong
2005-10-18  3:39             ` Richard M. Stallman
2005-10-18 14:33               ` Stefan Monnier
2005-10-19  8:35                 ` Kim F. Storm
2005-10-19 12:20                   ` David Kastrup
2005-10-19 12:45                     ` Chong Yidong
2005-10-19 20:17                       ` Richard M. Stallman
2005-10-19 12:51                     ` Kim F. Storm
2005-10-19 20:17                       ` Richard M. Stallman
2005-10-19 21:55                         ` Kim F. Storm
2005-10-19 13:27                 ` Miles Bader
2005-10-20  4:54                   ` Richard M. Stallman
2005-10-19  9:02             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1ERCR7-0002Lh-47@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=romain@orebokech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).