unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18361: New 'sort' implementation can crash Emacs
@ 2014-08-29 21:24 Paul Eggert
  2014-08-29 22:47 ` Dmitry Antipov
  0 siblings, 1 reply; 11+ messages in thread
From: Paul Eggert @ 2014-08-29 21:24 UTC (permalink / raw)
  To: 18361, dmantipov

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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-08-31 15:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-29 21:24 bug#18361: New 'sort' implementation can crash Emacs Paul Eggert
2014-08-29 22:47 ` Dmitry Antipov
2014-08-29 23:07   ` Paul Eggert
2014-08-30  5:07     ` Dmitry Antipov
2014-08-30  5:22       ` Paul Eggert
2014-08-30  6:55         ` Dmitry Antipov
2014-08-30 13:44           ` Paul Eggert
2014-08-30 23:05             ` Paul Eggert
2014-08-31  2:50               ` Eli Zaretskii
2014-08-31  4:46                 ` Paul Eggert
2014-08-31 15:20                   ` Eli Zaretskii

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).