|
From: | Paul Eggert |
Subject: | Re: JSON/YAML/TOML/etc. parsing performance |
Date: | Wed, 4 Oct 2017 10:51:33 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 10/04/2017 01:03 AM, Eli Zaretskii wrote:
Why didn't we add similar checks there?
If Emacs allocates the objects there is no problem, since it never allocates objects larger than PTRDIFF_MAX. Generally this is what gnutls.c and image.c do. There are places where they do need overflow checks (notably, image size calculation); in some cases the checks are there, in some they're old code that nobody has ever cleaned up and which undoubtedly has problems, and in either case the PTRDIFF_MAX versus SIZE_MAX issue is a bit of a sideshow as each image library has its own idea about what integer type to use.
We should not encourage more use of size_t within Emacs, as it's an unsigned type and unsigned types have the problems I mentioned.
[Prev in Thread] | Current Thread | [Next in Thread] |