[SERVER-2552] Message generated by emptyMoreResult() contains uninitialized resultFlags() and flags sent over the wire are nondeterministic Created: 15/Feb/11  Updated: 12/Jul/16  Resolved: 17/Mar/11

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

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

Operating System: ALL
Participants:

 Description   

Unlike other places where a QueryResult is created, resultFlags() aren't initialized in this function:

QueryResult* emptyMoreResult(long long cursorid)

{ BufBuilder b(32768); b.skip(sizeof(QueryResult)); QueryResult *qr = (QueryResult *) b.buf(); qr->cursorId = 0; // 0 indicates no more data to retrieve. qr->startingFrom = 0; qr->len = b.len(); qr->setOperation(opReply); qr->nReturned = 0; b.decouple(); return qr; }

Not sure if this would cause a problem with any drivers, but might make sense to ensure we have a deterministic response in such cases.



 Comments   
Comment by auto [ 17/Mar/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-2552 initialize result flags for empty get more result
https://github.com/mongodb/mongo/commit/1ef7155a4e48629bf94c5f6083f35eae4b17b2da

Generated at Thu Feb 08 03:00:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.