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.devel Subject: arc-mode.el bug or malformed ZIP file? Date: Thu, 24 Sep 2020 01:13:58 +0200 Message-ID: <875z846q89.fsf@rub.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30218"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 24 01:19:44 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kLE35-0007lZ-Si for ged-emacs-devel@m.gmane-mx.org; Thu, 24 Sep 2020 01:19:43 +0200 Original-Received: from localhost ([::1]:54750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLE34-0007Ep-NX for ged-emacs-devel@m.gmane-mx.org; Wed, 23 Sep 2020 19:19:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLDxh-0003iD-4d for emacs-devel@gnu.org; Wed, 23 Sep 2020 19:14:11 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:35969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLDxe-0000A6-Tc for emacs-devel@gnu.org; Wed, 23 Sep 2020 19:14:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600902842; bh=zyrP7413rdrnwhAbOMIWNhN3noI+wG3mH071/oDc7O0=; h=X-UI-Sender-Class:From:To:Subject:Date; b=QZ02IElGnx8r9h5YlbE7Ah+a5oDXz1q4kwohEyVu9LiDWXjrAY9f0zcxLKSp5wR8h e2tmWrRZtrqqaK4HnlAa8JL7zgVE/RUi6Ejyfg7CrcCFf40zqlOcygpZwFyaaM5j5k 0N77DDnKeFIIofaGwfqrdwT+fJMkxJ1lYRmJXHs8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([178.1.126.111]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MatVb-1krGaX32ZX-00cUCI for ; Thu, 24 Sep 2020 01:14:02 +0200 X-Provags-ID: V03:K1:9o4b6U9qg6EharEBGhsDPFAqMjEVI3lqMOt9IdZ7sjtilVsT1WH oswpUiCHBSfqaf0v44XBtDnOHuE4wQh7NQIZ7pFosiJE1A94xkza5FY0Yfsq5/+NObEwO1R 8HjS3J/69teenOzaF2mDPdbUQ+wHZ4+ceOyO/KwuDF5IVKSiGvmLmdpNTdguAh75/BWGkf/ 78lYygPdtl0dWCN5O8cEA== X-UI-Out-Filterresults: notjunk:1;V03:K0:g1bJXBqnuXw=:EAriBHTRqFNG1l3qCJQ1EQ sY1IipQhuV2Rz18THLgpM37r7wkniLD+yNZ0id4oJfRDhovFUwmu4H7iSSdO7/QnBq8CmjoX8 Oxl67DB7lqhfa0v4GSB8ZuSVK+UynqTsN9BgzTBvaOXcFUe17sk8nTIM/hHwH8uRr+ht7p+VI DISrnH+uUAtlIhZ9Ilh8956lNHrcBdH+ZsbeXBeBAg9sIz6c9RWnj/mXezQzcv+CRGmm1ttlg T8jHI9/biddiGOSxkURDQgJ/0mB07MyOnKlGX/1qALYgExSvRc1hnJ8loppT8mAux/Z6spfHC OZQmN3nL4oBQcZWbIugJ65AP40IcrFRxM86oWjbMhWrExtlPhp5XjTo2vv6P3mAJbYdJAskp/ 2fIMruiFXT5I5fsvlaRg09DWqKtG9rANimHsAUneKXJ72eJgScNJTJpbBx0eOK82scpWcFA3s JHyVxQnB+EDuNnO2KxBjqt7gy8ma+Cf8oVRU+segtinXxx3Q+g2Q7NDzd3ApKwvo/VmcbGW5+ 4PpzN9C9aYD9nSglAi6WZc4Bf+6YUSRJcd8kh5t+eCW5DFf4vI7AaIiwPVoSswPNBEMHtBcC6 oku4iSMz0VzTV6l3yGnA+2tbXZVNV+DRaXr1Ehy7FrMTT8wkzmBMaJxoSME7LL38jq6B9W/4X 4V+WDdmHUhJm9SPSWoCH32GUeZF8UyP7VCwQrWqR8CkHnETfEKfH7RR4f8osxMf0V34VCQG+o /TmtMehf3HzDP9kSWxhy7FMByXtJob7sAZ+KktZ7Ldt5CzaUXga42vmGH6aoAdclH10y/z7K Received-SPF: pass client-ip=212.227.17.22; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/23 19:14:03 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: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:256382 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 two 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. So is this a bug in arc-mode.el? Steve Berman