GNU bug report logs - #64686
30.0.50; Tar mode @PaxHeader bug

Previous Next

Package: emacs;

Reported by: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>

Date: Mon, 17 Jul 2023 18:33:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 64686 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>, 64686 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Fri, 28 Jul 2023 12:04:27 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii [2023-07-27 11:38 +0300] wrote:
> Should be fixed now on the master branch.

Thanks, but doesn't tar-parse-pax-extended-header mutate
tar-attr-vector, which is initialised with a constant vector?

E.g. (aset [nil] 0 nil) would normally result in:
Warning: ‘aset’ on constant vector (arg 1)

Is this a welcome change?

[tar.diff (text/x-diff, inline)]
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index e4ea95343e0..2b6329fecc3 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -255,15 +255,14 @@ pax-decode-string
       (decode-coding-string str coding)
     str))
 
-(defvar tar-attr-vector '[nil nil nil nil nil nil nil nil])
+(defvar tar-attr-vector (make-vector 8 nil))
 (defun tar-parse-pax-extended-header (pos)
   "Parse a pax external header of a Posix-format tar file."
   (let ((end (+ pos 512))
         (result tar-attr-vector)
         (coding 'utf-8-unix)
         attr value record-len value-len)
-    (dotimes (i 8)
-      (aset result i nil))
+    (fillarray result nil)
     (goto-char pos)
     (while (and (< pos end)
                 (re-search-forward pax-extended-attribute-record-regexp
[Message part 3 (text/plain, inline)]
Thanks,
-- 
Basil

This bug report was last modified 1 year and 296 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.