Skip Menu |
 

This queue is for tickets about the YAML-Syck CPAN distribution.

Report information
The Basics
Id: 42390
Status: resolved
Priority: 0/
Queue: YAML-Syck

People
Owner: Nobody in particular
Requestors: MMIMS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.05
Fixed in: (no value)



Subject: [PATCH] JSON::Syck does not properly escape/unescape JSON strings
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1231885434-24714-22"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 224
Download (untitled) / with headers
text/plain 224b
JSON::Syck fails to decode JSON strings with escaped characters correctly. For example: JSON::Syck::load('"http:\/\/example.com\/"') should decode to 'http://example.com/' I patched t/json-basic.t to produce failing tests.
Subject: json-syck.patch
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1231885434-24714-21"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/x-diff; name="json-syck.patch"
Content-Disposition: inline; filename="json-syck.patch"
Content-Transfer-Encoding: binary
Content-Length: 389
Download json-syck.patch
text/x-diff 389b
diff --git a/t/json-basic.t b/t/json-basic.t index dda0afc..6390c43 100644 --- a/t/json-basic.t +++ b/t/json-basic.t @@ -42,6 +42,14 @@ my @tests = ( '{"foo":""}', '["\"://\""]', '"~foo"', + '"\/"', # escaped solidus + '"\""', + '"\b"', + '"\f"', + '"\n"', + '"\r"', + '"\t"', + '"\u0001"', ); plan tests => scalar @tests * (2 + $HAS_JSON) * 2;
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-6780-1274354260-1277.42390-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1484
Download (untitled) / with headers
text/plain 1.4k
On Tue Jan 13 17:23:57 2009, MMIMS wrote: Show quoted text
> JSON::Syck fails to decode JSON strings with escaped characters > correctly. For example: > > JSON::Syck::load('"http:\/\/example.com\/"') should decode to > 'http://example.com/' > > I patched t/json-basic.t to produce failing tests.
Can you make these tests TODO so that they don't fail, unless you have a patch to fix them that is. Also, see this boring form letter I'm pasting around: (This is a form-reply that isn't specific to your particular report) YAML::Syck has just acquired one new maintainer (me), it still doesn't have anyone that *cares* about it. But I'm willing to help solve your report & release a new version with the fix if it's easy for me. It now has a Git repository at: http://github.com/avar/YAML-Syck If your report is a patch that fixes a problem, great. Please remake the patch against Git by forking that repo and sending me a pull request on GitHub (or an update to this bug if you prefer git-format-patch(1) or some other repo provider..). Make sure to include a test for what you fixed. If your report is some code that fails (and you have a testcase for it) a patch against the test suite to demonstrate that failure would be very useful. It's OK if the test crashes and burns, see Test::More's docs for how to make TODO tests that fail now, but shouldn't. Even if it segfaults perl C<system $^X => qw/ -Mblib -MYAML::Syck .../> or something like that and checking the return value will do.
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-6780-1274354260-1277.42390-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.8.HEAD-6780-1274354260-1277.42390-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2373-1279571757-651.42390-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 78
TODO tests pushed to github in commit a25d69e72828c1dcc80d8f07190cb1b4d1068c2f
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-24873-1285277969-1024.42390-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 465
Download (untitled) / with headers
text/plain 465b
On Tue Jan 13 17:23:57 2009, MMIMS wrote: Show quoted text
> JSON::Syck fails to decode JSON strings with escaped characters > correctly. For example: > > JSON::Syck::load('"http:\/\/example.com\/"') should decode to > 'http://example.com/' > > I patched t/json-basic.t to produce failing tests.
Greetings, discussing with the other Syck developers, we have a question for you. JSON::XS is 5 times faster than this module. Is there any reason you prefer JSON::Syck to JSON::XS?
From marc [...] questright.com Thu Sep 23 22: 33:03 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-9.384 tagged_above=-99.9 required=10 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8, RCVD_IN_SORBS_WEB=0.619, SPF_SOFTFAIL=0.596] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-24873-1285277970-985.42390-6-0 [...] rt.cpan.org>
Content-Disposition: inline
X-Spam-Flag: NO
References: <RT-Ticket-42390 [...] rt.cpan.org> <rt-3.8.HEAD-24873-1285277970-985.42390-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <20100924023600.GA12676 [...] questright.com>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -9.384
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 49B94240E6D for <cpan-bug+YAML-Syck [...] hipster.bestpractical.com>; Thu, 23 Sep 2010 22:33:03 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6iZpoFxJl-J1 for <cpan-bug+YAML-Syck [...] hipster.bestpractical.com>; Thu, 23 Sep 2010 22:33:01 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 33BEA240D43 for <bug-YAML-Syck [...] rt.cpan.org>; Thu, 23 Sep 2010 22:33:00 -0400 (EDT)
Received: (qmail 5067 invoked by uid 103); 24 Sep 2010 02:36:09 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 24 Sep 2010 02:36:09 -0000
Received: from mail-iw0-f178.google.com (HELO mail-iw0-f178.google.com) (209.85.214.178) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 23 Sep 2010 19:36:07 -0700
Received: by iwn35 with SMTP id 35so1717693iwn.9 for <bug-YAML-Syck [...] rt.cpan.org>; Thu, 23 Sep 2010 19:36:05 -0700 (PDT)
Received: by 10.231.190.149 with SMTP id di21mr2922440ibb.166.1285295764926; Thu, 23 Sep 2010 19:36:04 -0700 (PDT)
Received: from localhost (65-122-15-169.dia.static.qwest.net [65.122.15.169]) by mx.google.com with ESMTPS id n20sm1587715ibe.23.2010.09.23.19.36.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 23 Sep 2010 19:36:02 -0700 (PDT)
Delivered-To: cpan-bug+YAML-Syck [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #42390] [PATCH] JSON::Syck does not properly escape/unescape JSON strings
User-Agent: Mutt/1.5.20 (2009-06-14)
Return-Path: <marc [...] questright.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+YAML-Syck [...] hipster.bestpractical.com
X-RT-Mail-Extension: yaml-syck
Date: Thu, 23 Sep 2010 19:36:00 -0700
X-Spam-Level:
To: Todd Rinaldo via RT <bug-YAML-Syck [...] rt.cpan.org>
From: Marc Mims <marc [...] questright.com>
RT-Message-ID: <rt-3.8.HEAD-24877-1285295774-758.42390-0-0 [...] rt.cpan.org>
Content-Length: 856
Download (untitled) / with headers
text/plain 856b
* Todd Rinaldo via RT <bug-YAML-Syck@rt.cpan.org> [100923 14:39]: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=42390 > > > On Tue Jan 13 17:23:57 2009, MMIMS wrote:
> > JSON::Syck fails to decode JSON strings with escaped characters > > correctly. For example: > > > > JSON::Syck::load('"http:\/\/example.com\/"') should decode to > > 'http://example.com/' > > > > I patched t/json-basic.t to produce failing tests.
> > Greetings, discussing with the other Syck developers, we have a question for you. JSON::XS is 5 > times faster than this module. Is there any reason you prefer JSON::Syck to JSON::XS?
No. I prefer JSON::XS. I use JSON::Any, however, in my Net::Twitter module in oder to offer users to select their own preference. If I'm not mistaken, JSON::Syck has been demoted to an optional in JSON::Any if not remove entirely. -Marc
X-RT-Interface: REST
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
RT-Message-ID: <rt-4.0.18-27714-1494492922-1990.42390-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 73
Ticket migrated to github as https://github.com/toddr/YAML-Syck/issues/30


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.