From unknown Wed Jun 25 09:09:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#19154 <19154@debbugs.gnu.org> To: bug#19154 <19154@debbugs.gnu.org> Subject: Status: [PATCH] Extend file size support in paste. Reply-To: bug#19154 <19154@debbugs.gnu.org> Date: Wed, 25 Jun 2025 16:09:43 +0000 retitle 19154 [PATCH] Extend file size support in paste. reassign 19154 coreutils submitter 19154 Tobias Stoeckmann severity 19154 normal tag 19154 fixed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 23 13:50:40 2014 Received: (at submit) by debbugs.gnu.org; 23 Nov 2014 18:50:40 +0000 Received: from localhost ([127.0.0.1]:42948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XscF6-0001vo-BN for submit@debbugs.gnu.org; Sun, 23 Nov 2014 13:50:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57494) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XscF3-0001vf-9d for submit@debbugs.gnu.org; Sun, 23 Nov 2014 13:50:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XscEt-0006E6-6C for submit@debbugs.gnu.org; Sun, 23 Nov 2014 13:50:36 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XscEt-0006E2-3B for submit@debbugs.gnu.org; Sun, 23 Nov 2014 13:50:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XscEl-00064e-JN for bug-coreutils@gnu.org; Sun, 23 Nov 2014 13:50:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XscEe-0006Bk-2K for bug-coreutils@gnu.org; Sun, 23 Nov 2014 13:50:19 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:53379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XscEd-0006BN-Oj for bug-coreutils@gnu.org; Sun, 23 Nov 2014 13:50:11 -0500 Received: from localhost (p4FE30741.dip0.t-ipconnect.de [79.227.7.65]) by mrelayeu.kundenserver.de (node=mreue007) with ESMTP (Nemesis) id 0MgUqY-1XXFaj1hVm-00Ngyh; Sun, 23 Nov 2014 19:50:07 +0100 Date: Sun, 23 Nov 2014 19:50:05 +0100 From: Tobias Stoeckmann To: bug-coreutils@gnu.org Subject: [PATCH] Extend file size support in paste. Message-ID: <20141123185005.GA14828@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Provags-ID: V02:K0:64o0ncAmmRhu53ssQVoKvrgUyaRStzjCCF2qu5cI5L3 45ZeVjJskpF6VY11uuZ4O3A5SADPA7rjuFrwr70YNs6G0Mgzce Zet98pv91xBs8mFMFNtMfqMBpKVtCFGYBd7hx1k5JBi2bonhkK qIaJ6WPvKsSBjIVGWLrVUI/cv3flC6HiD8asxMltW9Buvm+sGS wuCNCr6FMxaUAvG/OUfKVfhfgQXMFzTR+ibSP3zT3qSm0/+1yU W0IB6H+gSKeVPt+XqgOqoVkD+R7vNg0vuVM/FSaMEI9nLH9G9M 8bhEySAsRJeD+v3HJ7jpI3HrAhU+6pZDV7TdZM8NHiy+F7VyUx FgvSbYUuEAoOT+ZlYq+0= X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) The function paste_parallel just has to remember if there was a character in a line at all, not how many. Changing size_t to a simple boolean statement removes a possible overflow situation with 4 GB files on 32 bit systems. --- src/paste.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/paste.c b/src/paste.c index 2ca75d0..630a9a6 100644 --- a/src/paste.c +++ b/src/paste.c @@ -235,7 +235,7 @@ paste_parallel (size_t nfiles, char **fnamptr) { int chr IF_LINT ( = 0); /* Input character. */ int err IF_LINT ( = 0); /* Input errno value. */ - size_t line_length = 0; /* Number of chars in line. */ + bool foundchar = false; /* Found chars in a line. */ if (fileptr[i]) { @@ -250,7 +250,7 @@ paste_parallel (size_t nfiles, char **fnamptr) while (chr != EOF) { - line_length++; + foundchar = true; if (chr == '\n') break; xputchar (chr); @@ -259,7 +259,7 @@ paste_parallel (size_t nfiles, char **fnamptr) } } - if (line_length == 0) + if (!foundchar) { /* EOF, read error, or closed file. If an EOF or error, close the file. */ -- 2.1.1 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 23 15:12:43 2014 Received: (at 19154) by debbugs.gnu.org; 23 Nov 2014 20:12:43 +0000 Received: from localhost ([127.0.0.1]:43012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsdWV-0006Xd-09 for submit@debbugs.gnu.org; Sun, 23 Nov 2014 15:12:43 -0500 Received: from mail2.vodafone.ie ([213.233.128.44]:43842) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsdWR-0006XU-VI for 19154@debbugs.gnu.org; Sun, 23 Nov 2014 15:12:40 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai4FACc/clRtT0bp/2dsb2JhbABbgw6DZM0MgycCgQYWAQEBAQF9hAMBAQQyAVYLDQsJFg8JAwIBAgFFBgEMCAEBiEEBvWaPJAELIJEShE4BBJwmhA8Shm0SjlWDfUiCewEBAQ Received: from unknown (HELO localhost.localdomain) ([109.79.70.233]) by mail2.vodafone.ie with ESMTP; 23 Nov 2014 20:12:37 +0000 Message-ID: <54723FB6.6010907@draigBrady.com> Date: Sun, 23 Nov 2014 20:12:38 +0000 From: =?windows-1252?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Tobias Stoeckmann , 19154@debbugs.gnu.org Subject: Re: bug#19154: [PATCH] Extend file size support in paste. References: <20141123185005.GA14828@localhost> In-Reply-To: <20141123185005.GA14828@localhost> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19154 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 23/11/14 18:50, Tobias Stoeckmann wrote: > The function paste_parallel just has to remember if there was a character > in a line at all, not how many. Changing size_t to a simple boolean > statement removes a possible overflow situation with 4 GB files on 32 bit > systems. > --- > src/paste.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/paste.c b/src/paste.c > index 2ca75d0..630a9a6 100644 > --- a/src/paste.c > +++ b/src/paste.c > @@ -235,7 +235,7 @@ paste_parallel (size_t nfiles, char **fnamptr) > { > int chr IF_LINT ( = 0); /* Input character. */ > int err IF_LINT ( = 0); /* Input errno value. */ > - size_t line_length = 0; /* Number of chars in line. */ > + bool foundchar = false; /* Found chars in a line. */ > > if (fileptr[i]) > { > @@ -250,7 +250,7 @@ paste_parallel (size_t nfiles, char **fnamptr) > > while (chr != EOF) > { > - line_length++; > + foundchar = true; > if (chr == '\n') > break; > xputchar (chr); > @@ -259,7 +259,7 @@ paste_parallel (size_t nfiles, char **fnamptr) > } > } > > - if (line_length == 0) > + if (!foundchar) > { > /* EOF, read error, or closed file. > If an EOF or error, close the file. */ > Nice one. This would result in truncation of the output iff there was a \n at position 2^32 in the file on a 32 bit system. I'll apply that in a little while (I can't think of an efficient way to test). Did you notice this through inspection or compiler warnings wrt integer overflow ? thanks! Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 23 15:26:53 2014 Received: (at 19154) by debbugs.gnu.org; 23 Nov 2014 20:26:53 +0000 Received: from localhost ([127.0.0.1]:43019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsdkD-0006rx-FY for submit@debbugs.gnu.org; Sun, 23 Nov 2014 15:26:53 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:64624) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsdkA-0006ro-FW for 19154@debbugs.gnu.org; Sun, 23 Nov 2014 15:26:51 -0500 Received: from oxbaltgw02.schlund.de (oxbaltgw02.schlund.de [172.19.246.8]) by mrelayeu.kundenserver.de (node=mreue005) with ESMTP (Nemesis) id 0MYrDT-1XNXym0tIx-00VczA; Sun, 23 Nov 2014 21:26:47 +0100 Date: Sun, 23 Nov 2014 21:26:47 +0100 (CET) From: =?UTF-8?Q?Tobias_St=C3=B6ckmann?= To: =?UTF-8?Q?P=C3=A1draig_Brady?= , 19154 <19154@debbugs.gnu.org> Message-ID: <40075749.38636.1416774407186.JavaMail.open-xchange@oxbaltgw02.schlund.de> In-Reply-To: <54723FB6.6010907@draigBrady.com> References: <20141123185005.GA14828@localhost> <54723FB6.6010907@draigBrady.com> Subject: Re: bug#19154: [PATCH] Extend file size support in paste. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.6.0-Rev23 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V02:K0:jU7J/aiqQNut+a2C1hf17CgZUEim8K4shmUMn4n0zbc CTkbT0J+V5hy8wcmSik1ThdoFFSmMomn4hLiTKRXAfe7DG6nhR od755PM3Ybfo7jeWFB3v3vl3C5JukxrFAMDflBdxFyTIlXGvc7 eE93Zb01Cyehm/qij4zPUm0OE84g6ZSJhWrWFHitcRECIR+3u3 Hek4ac6k5JGoiRneFF+cRShK7cNuGaYjpwQOOb/4H2cqoQpMWb fCeaoBseCLJnEHTOt7L2xhpbZBw/79ivoARZjLwQQeQTM2awy1 p2+mx/Do91nPno6pv5PCKlPoBl3STI/wQq9ATkkBHPyxdl38Xa 8SFZ/uev7NoyRFNHqbM7C6uDYn/D02DFZZUf/wAuRrSZN66aEd JCLNIu0zx+Hb5MR/UwH8O7kWf9brduXt6XER9bRJw1ieKAyr8i I1Mrm X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19154 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: =?UTF-8?Q?Tobias_St=C3=B6ckmann?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Haven't used any tool except an editor. ;) I was curious about paste's internals, so I gave my reviewing skills a try. Tobias > On November 23, 2014 at 9:12 PM P=C3=A1draig Brady wro= te: > Nice one. This would result in truncation of the output > iff there was a \n at position 2^32 in the file on a 32 bit system. > I'll apply that in a little while (I can't think of an efficient way to t= est). >=20 > Did you notice this through inspection or compiler warnings wrt integer > overflow ? >=20 > thanks! > P=C3=A1draig. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 10 11:55:21 2018 Received: (at 19154) by debbugs.gnu.org; 10 Oct 2018 15:55:21 +0000 Received: from localhost ([127.0.0.1]:43715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAGpU-0000ep-P1 for submit@debbugs.gnu.org; Wed, 10 Oct 2018 11:55:20 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:34881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAGpS-0000eR-Qs; Wed, 10 Oct 2018 11:55:19 -0400 Received: by mail-pf1-f180.google.com with SMTP id l17-v6so2856502pff.2; Wed, 10 Oct 2018 08:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=ilui0WcpJdJRpet0dEadTXB4A8dlOoavQsocyBDxE/0=; b=JA/bwdmh6fAHdTa/v5K+xd22itqhconGEOa+W5t/TPMSc4Z5alJEKaAwG9nTHnRDpB MnaBbmLOpGy7CfakHT5eDTX/OJ/uIa86W2Wrjd0rXz1VEBlcdhIuc0kuokR17IqXHjqa nUKTJCXwOimAdPEwk9bZswFr0iAOFqXnSJPdGhzD/3r45m0bayHGhTmG6PYLQwFTE4tF LNM/4MkU9a7JbO8Pkupa9ZQhUjPjfnjt0ZIqfSjkgClgFpIz/ZVuBR62cgczuwR8G0nO puUD3jyVKJfl5U2Azf5KRjBu96PhuLzd+vz4hk+imSVgKl/zmHXXAQWkK+A3/UKg2xp+ XKiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=ilui0WcpJdJRpet0dEadTXB4A8dlOoavQsocyBDxE/0=; b=gId+y8iByrB9PwqYOFkhkWBtA564UL1F6qdl5F6SdhAUJO3HVzK6uwPI5bpZNotG5T sGOzZ6RFq04XeCHaq6wg9kx6g/0jVIPu1046VY+hKbG5uRoP4WdcQ0KPLWt0e7W+RV3l erAV/mDAalZ11DXIcC94N4SqAwEuw+PigEUCMAXXf1xRln5GJWVDpyje3bjIsnRRC5pJ N2fJbfdIZTWus170DQjFa09+BfqNCKCsjf3M94J9bCpfOTxcEakENhcy5tpm1ti4hGg9 zZoJBm46PU69RwO+F2ooQZhR97cIF7FVPcaXPtee9OBVdFiNg4YWr5zrr2T/Lnm2ynxO IxRQ== X-Gm-Message-State: ABuFfohpu/yKn/6pdBc0LJ0TTJDoamRUr6vjZAYSHSc6lPtW+M9ApM3f OdVndHXFpIugxEI4a9CzxGGGhkilK/k= X-Google-Smtp-Source: ACcGV617Iu81Ykl352T/rRJUV0irzD7xcggdRweLtMKkXdMlIh3Pt0AU5Yv7gpukmMYgLM2TKMTypA== X-Received: by 2002:a63:a42:: with SMTP id z2-v6mr29737030pgk.209.1539186912570; Wed, 10 Oct 2018 08:55:12 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id x13-v6sm20128420pge.13.2018.10.10.08.55.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 08:55:11 -0700 (PDT) To: 19154@debbugs.gnu.org From: Assaf Gordon Message-ID: Date: Wed, 10 Oct 2018 09:55:10 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 19154 fixed close 19154 stop Pushed in https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=16e2347bd545057b04a97115563e606ad822ec33 closing. [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.210.180 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.210.180 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: 19154 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 19154 fixed close 19154 stop Pushed in https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=16e2347bd545057b04a97115563e606ad822ec33 closing. From unknown Wed Jun 25 09:09:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 08 Nov 2018 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator