If the length of the string is maxlen, we would end up copying maxlen+1
bytes, which violates the contract of the function. The result is the
same since that extra byte is overwritten.
Reported by: Kevin Day <kevin@your.org>
Differential D54093
libkern: Avoid a one-byte OOB access in strndup() Authored by markj on Fri, Dec 5, 9:39 PM. Tags None Referenced Files
Subscribers
Details
If the length of the string is maxlen, we would end up copying maxlen+1 Reported by: Kevin Day <kevin@your.org>
Diff Detail
Event Timeline
| ||||||||||||||||||||||||||||||||