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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32249 in the body.
You can then email your comments to 32249 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#32249; Package diffutils. (Mon, 23 Jul 2018 15:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to mancha <mancha1 <at> zoho.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Mon, 23 Jul 2018 15:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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 1 (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 3 (application/pgp-signature, inline)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 24 Jul 2018 17:21:02 GMT) Full text and rfc822 format available.

Notification sent to mancha <mancha1 <at> zoho.com>:
bug acknowledged by developer. (Tue, 24 Jul 2018 17:21:02 GMT) Full text and rfc822 format available.

Message #10 received at 32249-done <at> debbugs.gnu.org (full text, mbox):

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 1 (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)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 22 Aug 2018 11:24:06 GMT) Full text and rfc822 format available.

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

Previous Next


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