[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: |
|
||||
| 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: Our strnlen differed from the c standard by using int rather than size_t and |