bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#18361: New 'sort' implementation can crash Emacs


From: Dmitry Antipov
Subject: bug#18361: New 'sort' implementation can crash Emacs
Date: Sat, 30 Aug 2014 02:47:01 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

On 08/30/2014 01:24 AM, Paul Eggert wrote:

The new implementation of 'sort' in the trunk invokes qsort (or qsort_r),
but these functions have undefined behavior if the comparison function is
ill-behaved.  Since the comparison predicate is user-defined, this means
a bad user-supplied comparison function could crash Emacs.

I don't see how is that possible if we operate on a correctly initialized
vector and sort_vector_predicate is a valid function accepting 2 arguments.
Can you provide an example?  Is that just a poor property of the particular
qsort(_r) implementation?

Dmitry





reply via email to

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