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: Paul Eggert
Subject: bug#18361: New 'sort' implementation can crash Emacs
Date: Fri, 29 Aug 2014 14:24:53 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

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.

One possible fix would be to build on the proposed patch in Bug#18360, except to change Emacs to always define its own qsort_r substitute, one that is known to produce some permutation of the input without crashing even if the comparison function is ill-behaved.





reply via email to

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