| … | … | @@ -548,6 +548,12 @@ ValuePtr Json::decode_value(const std::string& s, |
| 548 | 548 | l++; |
| 549 | 549 | r = s.find_first_of(",]", l); |
| 550 | 550 | if (std::string::npos == r) break; |
| 551 | |
| 552 | // Bad clients can (and do) send mal-formed JSON. |
| 553 | // This includes the empty list [] and expressions |
| 554 | // with a trailing comma. Skip out of those. |
| 555 | if (r == l) break; |
| 556 | |
| 551 | 557 | std::stringstream ss; |
| 552 | 558 | ss << s.substr(l, r-l); |
| 553 | 559 | double d; |
| … | … | @@ -574,6 +580,12 @@ ValuePtr Json::decode_value(const std::string& s, |
| 574 | 580 | while (std::string::npos != l) |
| 575 | 581 | { |
| 576 | 582 | l++; |
| 583 | |
| 584 | // Bad clients can (and do) send mal-formed JSON. |
| 585 | // This includes the empty list [] and expressions |
| 586 | // with a trailing comma. Skip out of those. |
| 587 | if (']' == s[l]) break; |
| 588 | |
| 577 | 589 | std::stringstream ss; |
| 578 | 590 | ss << s.substr(l); |
| 579 | 591 | std::string uq; |