user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* Re: [PATCH] t/git.t: avoid passing read-only value to git_unquote
  2019-01-18 19:47 14% ` [PATCH] t/git.t: avoid passing read-only value to git_unquote Eric Wong
@ 2019-01-18 20:07  8%   ` Konstantin Ryabitsev
  0 siblings, 0 replies; 2+ results
From: Konstantin Ryabitsev @ 2019-01-18 20:07 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta

On Fri, Jan 18, 2019 at 07:47:06PM +0000, Eric Wong wrote:
> > 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...

No, this is RHEL/CentOS 7.

> > Git: 2.16.5
> > Tree: d66aa534a4a7506cfc5cfab49d1e09f8db8be3dd
> 
> Thanks for the report, following should fix it.

Yep, all tests pass now. Thanks!

-K

^ permalink raw reply	[relevance 8%]

* [PATCH] t/git.t: avoid passing read-only value to git_unquote
  @ 2019-01-18 19:47 14% ` Eric Wong
  2019-01-18 20:07  8%   ` Konstantin Ryabitsev
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-01-18 19:47 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: meta

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

^ permalink raw reply related	[relevance 14%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-01-18 17:20     git.t test failing in master Konstantin Ryabitsev
2019-01-18 19:47 14% ` [PATCH] t/git.t: avoid passing read-only value to git_unquote Eric Wong
2019-01-18 20:07  8%   ` Konstantin Ryabitsev

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).