[SERVER-76823] DB Name Error Checking prints SIZE_MAX instead of actual user-provided string size Created: 03/May/23  Updated: 29/Oct/23  Resolved: 05/May/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Matt Kneiser Assignee: Matt Broadstone
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:
Linked BF Score: 135

 Description   

From a BF investigation.

 

Testing on a standalone from a day-old version of master, I see this:

MongoDB Enterprise > db.adminCommand({renameCollection: 'Non-numeric data in input field which evaluates to an array should be ignored', to: 'test.b'})
{
 "ok" : 0,
 "errmsg" : "db name must be at most 63 characters, found: 18446744073709551615",
 "code" : 73,
 "codeName" : "InvalidNamespace"
}
 
 
 

Looking at the two locations that would produce this I see:

      • There's some delicate error checking here, and std::string::npos (i.e. SIZE_MAX) gets printed.

SERVER-75529 appears to have touched a lot of this size handling.



 Comments   
Comment by Githook User [ 05/May/23 ]

Author:

{'name': 'Matt Broadstone', 'email': 'mbroadst@mongodb.com', 'username': 'mbroadst'}

Message: SERVER-76823 Report accurate dbname length in NSS length assertion
Branch: master
https://github.com/mongodb/mongo/commit/d66daf618a9005eaba4a8c9fa3746ef27ab80427

Generated at Thu Feb 08 06:33:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.