user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: meta@public-inbox.org
Subject: [PATCH] t/git.t: avoid passing read-only value to git_unquote
Date: Fri, 18 Jan 2019 19:47:06 +0000	[thread overview]
Message-ID: <20190118194706.ubssl3oehd4zn7f2@whir> (raw)
In-Reply-To: <20190118172056.GB5108@pure.paranoia.local>

Konstantin Ryabitsev <konstantin@linuxfoundation.org> wrote:
> This is probably fairly benign from the looks of it, but I'd like your
> opinion on whether this is something to worry about before deploying.

Yeah, the actual code only hits modifiable value

> Perl: v5.16.3

This is Fedora?  Which version?  I was working on getting a
chroot setup for testing some RPM-based distros, but some of the
mirrors/tools for doing that were out-of-date.  Might try
installing in QEMU...

> Git: 2.16.5
> Tree: d66aa534a4a7506cfc5cfab49d1e09f8db8be3dd

Thanks for the report, following should fix it.

----------8<--------
Subject: [PATCH] t/git.t: avoid passing read-only value to git_unquote

Older versions of Perl (tested 5.14.2 on Debian wheezy(*),
reported by Konstantin on Perl 5.16.3) considered the result of
concatenating two string literals to be a constant value.

(*) not that other stuff works on wheezy, but t/git.t should.

Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
---
 t/git.t | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/t/git.t b/t/git.t
index 50ec4fb..052e1ce 100644
--- a/t/git.t
+++ b/t/git.t
@@ -145,7 +145,8 @@ if ('alternates reloaded') {
 }
 
 use_ok 'PublicInbox::Git', qw(git_unquote);
-is("foo\nbar", git_unquote('"foo\\nbar"'.''), 'unquoted newline');
-is("Eléanor", git_unquote('"El\\303\\251anor"'.''), 'unquoted octal');
+my $s;
+is("foo\nbar", git_unquote($s = '"foo\\nbar"'), 'unquoted newline');
+is("Eléanor", git_unquote($s = '"El\\303\\251anor"'), 'unquoted octal');
 
 done_testing();
-- 
EW

  reply	other threads:[~2019-01-18 19:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 17:20 git.t test failing in master Konstantin Ryabitsev
2019-01-18 19:47 ` Eric Wong [this message]
2019-01-18 20:07   ` [PATCH] t/git.t: avoid passing read-only value to git_unquote Konstantin Ryabitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190118194706.ubssl3oehd4zn7f2@whir \
    --to=e@80x24.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).