GNU bug report logs - #32249
[BUGFIX] cmp -b mangles result

Previous Next

Package: diffutils;

Reported by: mancha <mancha1 <at> zoho.com>

Date: Mon, 23 Jul 2018 15:42:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#32249: closed ([BUGFIX] cmp -b mangles result)
Date: Tue, 24 Jul 2018 17:21:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 24 Jul 2018 10:20:21 -0700
with message-id <cfd3fe6e-6f08-f52d-add0-12d3a316f61d <at> cs.ucla.edu>
and subject line Re: [bug-diffutils] bug#32249: [BUGFIX] cmp -b mangles result
has caused the debbugs.gnu.org bug report #32249,
regarding [BUGFIX] cmp -b mangles result
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
32249: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32249
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: mancha <mancha1 <at> zoho.com>
To: bug-diffutils <at> gnu.org
Subject: [BUGFIX] cmp -b mangles result
Date: Mon, 23 Jul 2018 06:48:26 +0000
[Message part 3 (text/plain, inline)]
Hi. count_newlines is passed the wrong buffer length (off-by-one) so it
overwrites first differing byte in first file's buffer. Attached patch
fixes.

Actual:

$ cmp -b <(echo bad) <(echo bug)
[snip] differ: byte 2, line 1 is  12 ^J 165 u


Expected:

$ cmp -b <(echo bad) <(echo bug)
[snip] differ: byte 2, line 1 is 141 a 165 u

Cheers!

--mancha
[cmp-newlines.patch (text/plain, attachment)]
[Message part 5 (application/pgp-signature, inline)]
[Message part 6 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: mancha <mancha1 <at> zoho.com>, 32249-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#32249: [BUGFIX] cmp -b mangles result
Date: Tue, 24 Jul 2018 10:20:21 -0700
[Message part 7 (text/plain, inline)]
Thanks for the bug report. I suspect that fix won't work in general, 
though, and I installed the attached fix instead.
[0001-cmp-fix-bug-in-b-diagnostic.patch (text/x-patch, attachment)]

This bug report was last modified 6 years and 360 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.