RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1024302 - perl-JSON-PP: produces invalid JSON
Summary: perl-JSON-PP: produces invalid JSON
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: perl-JSON-PP
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: perl-maint-list
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks: 1024293
TreeView+ depends on / blocked
 
Reported: 2013-10-29 11:12 UTC by Florian Weimer
Modified: 2013-10-29 15:49 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-29 15:01:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2013-10-29 11:12:23 UTC
JSON:PP escapes "'" characters, which is not allowed according to RFC 4627 and will cause deserialization errors with other JSON implementations:

$ perl -Ilib -MJSON::PP -MData::Dumper -we "print Dumper(encode_json([\"<<'>>\"]))"
$VAR1 = '["<<\'>>"]';

(The documentation still refers to_json, which has been obsoleted, BTW.)

Comment 2 Petr Pisar 2013-10-29 15:01:41 UTC
The solidus escaping an apostrophe is result of Data::Dumper::Dumper(). The JSON::PP::encode_json() does not do that. See simpler case:

$ perl -MJSON::PP -e "print encode_json([qq{'}]), qq{\n}"
["'"]

Comment 3 Florian Weimer 2013-10-29 15:49:47 UTC
Ugh, sorry about that.  You are right, of course.  This part of the source code confused me:

    my %esc = (
        "\n" => '\n',
        "\r" => '\r',
        "\t" => '\t',
        "\f" => '\f',
        "\b" => '\b',
        "\"" => '\"',
        "\\" => '\\\\',
        "\'" => '\\\'',
    );

        $arg =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/g;

' is present in the hash, but not in the regular expression.


Note You need to log in before you can comment on or make changes to this bug.