unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: 43597@debbugs.gnu.org
Subject: bug#43597: 28.0.50; arc-mode.el fails to display a ZIP file
Date: Thu, 24 Sep 2020 22:02:50 +0200	[thread overview]
Message-ID: <874knnvt79.fsf@gmx.net> (raw)

I have a ZIP file that, when I try to visit it in archive-mode, Emacs
throws a file mode specification error on, specifically
args-out-of-range.  The reason is that the function archive-l-e in
arc-mode.el, which is supposed to return a buffer position in this case,
returns a number which exceeds the buffer size.  And the reason for this
is that archive-l-e builds its return value by iteratively calling (+
(ash result 8) (aref str (- len i))), where `str' is a string extracted
from the end of the ZIP file, which in this case is "\377\377\377\377",
so that the return value increases from 255 (the decimal value of octal
377) to 4294967040 after four iterations, which far exceeds the file
(and hence buffer) size.

Perhaps "\377\377\377\377" is an invalid string at the end of a ZIP file
(I checked other ZIP files I have, which I can visit in archive-mode
with no problem, and they have different strings at the end, consisting
of bytes with smaller decimal values, so that the return value of
archive-l-e does not exceed the file size).  Yet when I call `unzip -l'
on the file in the shell, the contents are displayed, and I also had no
problem unpacking the file with unzip (and AFAICT the content is
undamaged).  So at least unzip can deal with this file.

In case it helps, here is the final byte sequence in the file (I've
replace the control characters and raw bytes by ASCII representations):

PK^E^F\377\377\377\377%^@%^@\377\377\377\377\377\377\377\377^@^@


In GNU Emacs 28.0.50 (build 25, x86_64-pc-linux-gnu, GTK+ Version 3.24.17, cairo version 1.17.3)
 of 2020-09-24 built on strobe-jhalfs
Repository revision: 89dd8cd215148da4c6dffc15dc6c35df5122247b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Linux From Scratch SVN-20200401

Configured using:
 'configure 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD PDUMPER LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix





             reply	other threads:[~2020-09-24 20:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24 20:02 Stephen Berman [this message]
2020-09-24 20:25 ` bug#43597: 28.0.50; arc-mode.el fails to display a ZIP file Andreas Schwab
2020-09-24 20:40   ` Stephen Berman
2020-09-24 21:58     ` Stephen Berman
2020-09-24 22:20       ` Stephen Berman
2020-09-25  6:01     ` Eli Zaretskii
2020-09-25  7:13       ` Stephen Berman
2020-09-25  9:37         ` Eli Zaretskii
2020-09-25  9:53           ` Eli Zaretskii
2020-09-25 10:32             ` Stephen Berman
2020-09-25 11:00             ` Eli Zaretskii
2020-09-25 12:05               ` Stephen Berman
2020-09-25 12:38                 ` Eli Zaretskii
2020-09-25 12:43                   ` Eli Zaretskii
2020-09-25 12:49                     ` Stephen Berman
2020-09-25 13:33                     ` Eli Zaretskii
2020-09-25 13:58                       ` Stephen Berman
2020-09-25 14:12                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874knnvt79.fsf@gmx.net \
    --to=stephen.berman@gmx.net \
    --cc=43597@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).