coheigea opened a new pull request, #3141: URL: https://github.com/apache/cxf/pull/3141
When parsing a JSON key name, the parser used a simple "find the next " character" search. This meant if a key contained an escaped quote — like "foo\"bar" — the parser would stop at the \" inside the key and think the key had already ended. It would extract foo\ as the key name instead of the correct foo"bar, then get confused about where the value was. - Find the closing quote correctly. Instead of stopping at the first " it sees, the parser now counts how many backslashes come immediately before each ". An odd number of backslashes means the quote is escaped (it's part of the key, keep going); an even number means those backslashes are paired escape sequences and the " is the real end of the key. - Unescape the key name. After finding the correct boundary, the raw content foo\"bar is decoded — \" becomes " — so the key stored in the map is the actual intended string foo"bar. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
