Within the ReadCodeWithScope method of bsonrw.valueReader we don't check the length of strBytes before attempting to remove the null byte. This can cause a panic if the BSON is invalid and strLength is 0.
To fix this we need to check the length of strBytes and if it's 0 we need to return an error because the BSON is invalid.
Thanks to @dgryski for raising this.