[SERVER-16258] Audit all uses of strnlen Created: 20/Nov/14  Updated: 11/Feb/15  Resolved: 08/Dec/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 2.8.0-rc3

Type: Task 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

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Our version of strnlen returns a different value than the standard strnlen in the case where no NUL byte is found (-1 rather than maxsize). We need to audit all existing uses and verify which they are expecting. Additionally we should either rename it, remove it, or give it the standard behavior (and only on platforms that lack a real strnlen).



 Comments   
Comment by Githook User [ 08/Dec/14 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-16258 Remove our strnlen and audit all callers

Our strnlen differed from the c standard by using int rather than size_t and
return -1 rather than the max length when not finding a NUL byte.
Branch: master
https://github.com/mongodb/mongo/commit/860f2856604b236d6048255a1bc308c9582cc7db

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