From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#43597: 28.0.50; arc-mode.el fails to display a ZIP file Date: Thu, 24 Sep 2020 22:02:50 +0200 Message-ID: <874knnvt79.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9233"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 43597@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 24 22:07:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLXWK-0002Hw-Nu for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Sep 2020 22:07:12 +0200 Original-Received: from localhost ([::1]:37480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLXWJ-0004zI-JG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Sep 2020 16:07:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLXTI-0003rx-ML for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 16:04:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLXTG-0002kb-GD for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 16:04:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kLXTG-00026g-CV for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 16:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Sep 2020 20:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43597 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16009777868018 (code B ref -1); Thu, 24 Sep 2020 20:04:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Sep 2020 20:03:06 +0000 Original-Received: from localhost ([127.0.0.1]:41815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLXSM-00025G-Hv for submit@debbugs.gnu.org; Thu, 24 Sep 2020 16:03:06 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLXSK-000258-Ba for submit@debbugs.gnu.org; Thu, 24 Sep 2020 16:03:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLXSH-0002rM-A4 for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 16:03:04 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:45461) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLXSC-0002ee-Us for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 16:03:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600977775; bh=XF1eNzVN3MHDzd4ovGC16JBuobrbJjxK0vOqBEqO5e0=; h=X-UI-Sender-Class:From:To:Subject:Date; b=dXxO8r9GToK77hsweJymkUD4T9sk4xqh4HH+wRTb/lhbeugQBNHMOmWVwsIDk4h+G JwRQFw0kNKH0nCAI89jMvzeB8CnFIRzkEbL6OamiyY2cyhk4rkTr/BeXNu4qhwff7k bYj5xIIci/LU6lvIEvoWzMeoi77Mi3PKqhm6lhHw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([178.6.220.84]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mi2O1-1kzFvS2ExV-00e7wr for ; Thu, 24 Sep 2020 22:02:55 +0200 X-Provags-ID: V03:K1:iVYOL2WSWFVC4p6Rw5C3KQ1TQEJnej/7EeZfNZkvbCITqJ5z2Vt 1KvtihOEy4/Ax9lSaTfX88GymCmQxTLxT2PudMelh5YP8c/kS+PR3ZKQLkYfgGk/JdktIEV TjtYm5aSheO2msgrZjyEGbwG/MGAYWEMHm+XDDA0dVpqRi1JJVnspL/D6/1lATSEajypjnU tuVYNM/4k7IH9NiR1FIJA== X-UI-Out-Filterresults: notjunk:1;V03:K0:sYshL8VyeM0=:Aap38p43ZvnUxlUyqBnwYm 3lmKiWAMObLUqVvwQIP/Hj6BbPCIrR3Bp53pzdCk8Sq/SJmTerQH2GVkX+nQrqhRWxUIy6DlB +PRB0O8Y7yTg/rkNrPpa4O13nXfMf9h4GhB5K9BZJwyhEeDKhP4IC7qs0cCksLrj1aa0bSGm5 905aHX5cdPI4wG17Ta5ifajON641yQNdSwmoXnVFnQa7gX2triaoUZ5jq1JDO6SRr9YMM4QM5 ckWfJK/eyzzhXsXyfBYzi0rH/0fSGvCj4xaoFTrFYdjCdK+/0Tph121/WBvRhhgV2APN/0nzX w1ig3wXgAdDC0eSJwYaixfrOS2wZGcGYcCnJF75q7HJqamybq1jpGdbXMn7O0AUpu8M5H1Qiq ZZdM0sxYcIrdAsUaVxH29YszcCUr7ig+RQ/nHRJp8Y2balYfp5O9Y7h48cbSU1bHoLAHeWCbC 0IooRcSM5HIiv5c1yEPJeYogont8GITonyTeTlHcD2KvZGtgxSDLFpVR4v0GHq7rY3UBdp14H T/xDPROy7p98fbnbmVXAmaDh8Y8RYx42wSMZCCFyLjQWlRvxab0ohuze4CX+ZFFnrom+44PnG 9DFqzooDzm8FaWUZ6Y5f+BZZh6VL/W0JURv2S51dYd71e3yYRD15z9YvdnVa8UgDHNUhK68cD /j0OXFppAHT7uVXIdb0VviOySLaVgERY60INHKMb0ANAWr9t5w/1Xuf2S2pWqkp08Yb7bWTBb oKiTLK/0VjWAZiwKAPju3pG2YMIgz3fBeKl1rfXWIqTAq3cgJxI/z6xDBLgWqk+j1B2mf7tO Received-SPF: pass client-ip=212.227.17.21; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/24 16:02:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188904 Archived-At: 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