[SERVER-3601] Create collection command should check type of argument Created: 15/Aug/11 Updated: 11/Jul/16 Resolved: 15/Aug/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.0.0-rc0 |
| 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 | ||
| Attachments: |
|
| Operating System: | ALL |
| Participants: |
| Description |
|
Currently assumes it is a string without checking. This causes the following commands to treat garbage memory as strings. I haven't been able to crash the server with this, but I do get some odd collection names: > db.runCommand( {create:true}) { "ok" : 1 }> db.runCommand( {create:null}) { "ok" : 1 }> db.createCollection() // same as {create:undefined} { "ok" : 1 }> show tables see attached one-line patch for an easy fix which gives a helpful message: > db.createCollection() |