GNU bug report logs -
#43597
28.0.50; arc-mode.el fails to display a ZIP file
Previous Next
Reported by: Stephen Berman <stephen.berman <at> gmx.net>
Date: Thu, 24 Sep 2020 20:04:02 UTC
Severity: normal
Found in version 28.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#43597: 28.0.50; arc-mode.el fails to display a ZIP file
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 43597 <at> debbugs.gnu.org.
--
43597: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43597
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> From: Stephen Berman <stephen.berman <at> gmx.net>
> Cc: 43597 <at> debbugs.gnu.org
> Date: Fri, 25 Sep 2020 15:58:36 +0200
>
> > Anyway, here's the proposed patch, please test:
>
> It works for me (at first I applied it to master and the patch partly
> failed to apply, then I looked at the line numbers and realized it was
> for Emacs 27). Thanks.
Thanks, installed on the emacs-27 branch, and closing the bug.
[Message part 3 (message/rfc822, inline)]
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
This bug report was last modified 4 years and 298 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.