]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix crash (segfault) in etags on generating tags for Erlang files
authorSerge Tupchii <serge.tupchii@protonmail.com>
Tue, 8 Dec 2020 20:22:34 +0000 (21:22 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 8 Dec 2020 20:22:34 +0000 (21:22 +0100)
* lib-src/etags.c: Set allocated and lastlen to zero, after
freeing last ptr in Erlang_functions to prevent dereferencing NULL
pointer (bug#45122).
Copyright-paperwork-exempt: yes

lib-src/etags.c

index 4315771a496d680fb544cc3eeed054cad1fa6967..a1c6837e8805d3ff7eb120a9d7c8175b1f2122d9 100644 (file)
@@ -6063,6 +6063,7 @@ Erlang_functions (FILE *inf)
            {
              free (last);
              last = NULL;
+             allocated = lastlen = 0;
            }
        }
       else