summaryrefslogtreecommitdiff
path: root/jstests/core/null_field_name.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/null_field_name.js')
-rw-r--r--jstests/core/null_field_name.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/core/null_field_name.js b/jstests/core/null_field_name.js
new file mode 100644
index 00000000000..7fa14b0a1bc
--- /dev/null
+++ b/jstests/core/null_field_name.js
@@ -0,0 +1,8 @@
+// SERVER-10313: Test that null char in field name causes an error when converting to bson
+assert.throws( function () { Object.bsonsize({"a\0":1}); },
+ null,
+ "null char in field name");
+
+assert.throws( function () { Object.bsonsize({"\0asdf":1}); },
+ null,
+ "null char in field name"); \ No newline at end of file