Subject: Re: bug#6378: all-completions Segfault

From: Juanma Barranquero <[email-masked]>
Date: Tue, 8 Jun 2010 18:41:07 +0200

On Tue, Jun 8, 2010 at 17:46, Nathan Weizenbaum <[email-masked]> wrote:

>   (all-completions "" [])
>
> I think the problem is on line 1593 of src/minibuf.c, but my
> Emacs-innards-fu isn't good enough to attempt a fix.

minibuf.c:1617, at this code:

	      if (XSYMBOL (bucket)->next)

because bucket has been assigned random junk from the nonexistent item
at position 0 in COLLECTION.

It should be fixed with the attached patch.

    Juanma

2010-06-08  Juanma Barranquero  <[email-masked]>

	* minibuf.c (Fall_completions): Check COLLECTION's size.  (Bug#6378)

=== modified file 'src/minibuf.c'
--- src/minibuf.c	2010-01-13 08:35:10 +0000
+++ src/minibuf.c	2010-06-08 16:34:41 +0000
@@ -1591,5 +1591,5 @@
     {
       obsize = XVECTOR (collection)->size;
-      bucket = XVECTOR (collection)->contents[index];
+      bucket = obsize ? XVECTOR (collection)->contents[index] : zero;
     }