From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: bug#30116: [PATCH] `substitute' crashes when file contains NUL characters (core-updates)) Date: Wed, 13 Jun 2018 21:40:49 -0400 Message-ID: <877en2taam.fsf@gmail.com> References: <87r2qrc3mq.fsf@gmail.com> <87k1wjc35d.fsf_-_@gmail.com> <87h8rk4kl9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTHG5-0001qV-5O for bug-guix@gnu.org; Wed, 13 Jun 2018 21:41:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTHG2-0002cL-0v for bug-guix@gnu.org; Wed, 13 Jun 2018 21:41:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:39224) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTHG1-0002cH-Rr for bug-guix@gnu.org; Wed, 13 Jun 2018 21:41:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fTHG1-0000Td-JB for bug-guix@gnu.org; Wed, 13 Jun 2018 21:41:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87h8rk4kl9.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 17 Jan 2018 15:37:54 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30116@debbugs.gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Maxim Cournoyer skribis: > >> From 9891e428eae0ed24e0d61862b3f5e298606b79eb Mon Sep 17 00:00:00 2001 >> From: Maxim Cournoyer >> Date: Sun, 14 Jan 2018 20:31:33 -0500 >> Subject: [PATCH] utils: Prevent substitute from crashing on files contai= ning >> NUL chars. >> >> Fixes issue #30116. >> >> * guix/build/utils.scm (substitute): Add condition to skip lines contain= ing >> the NUL character. > > [...] > >> + ((string-contains line (make-string 1 #\nul)) > > Rather (string-index line #\nul). > >> + ;; The regexp functions of the GNU C library (which Guile u= ses) >> + ;; cannot deal with NUL characters, so skip to the next lin= e. >> + (format #t "skipping line with NUL characters: ~s\n" line) >> + (loop (read-line in 'concat))) > > Rather (format (current-error-port) =E2=80=A6). > > It=E2=80=99s strange semantics, but it=E2=80=99s probably better than cra= shing in the > contexts where we use it. > > Otherwise LGTM. This would have to go to the next =E2=80=98core-updates= =E2=80=99 (or > =E2=80=98core-updates-next=E2=80=99 in the meantime.) > > Thanks! > > Ludo=E2=80=99. Ping. Is it the right time to merge this? Maxim