Project

General

Profile

Actions

Bug #55212

closed

JSONFormattable incorrectly sets a string starting with digit as int

Added by Soumya Koduri about 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

JSONFormattable::set calls JSONParser::parse() to check if the given string
is a valid JSON object, which internally uses json_spirit::read to determine
the string type and copy it into data.
This routine incorrectly sets data type to integer if the string starts with
digit and copies only the first set of numeric values of the string.

For eg:
radosgw-admin zone modify --rgw-zone=cloud-zone --rgw-zonegroup=default --tier-config=connection.access_key=312CNV15CC2ZN44IPB24A

Output:
"tier_config": {
"connection": {
"access_key": 312,
"secret": "W0X3NbPXNW1B7Ru79xuuUI53ftSKieEl2ouuHP8C"
}
},

As can be seen in above output only first set of digits of the input string are copied. The same issue exists for even real & bool types.

Actions #2

Updated by Casey Bodley almost 2 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF