[SERVER-1416] fromjson can cause a crash Created: 13/Jul/10  Updated: 12/Jul/16  Resolved: 13/Jul/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.5

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

fromjson("

{a:1,'sub.b':2,'sub.c':3}

"); <---- works
fromjson("

{a:1,sub.b:2,sub.c:3}

"); <---- crashes

terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_S_create
Aborted



 Comments   
Comment by Mathias Stearn [ 13/Jul/10 ]

Dots without quotes are still not allowed but it won't crash anymore.

Comment by auto [ 13/Jul/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'redbeard0531@gmail.com'}

Message: I didn't understand strnlen's return value SERVER-1416
http://github.com/mongodb/mongo/commit/f4266aedd22c75d64c0250ecf62d21bcdfd31766

Generated at Thu Feb 08 02:56:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.