Page MenuHomeFreeBSD

Let l64a() properly null terminate its result.
ClosedPublic

Authored by ed on May 23 2016, 3:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 16 2024, 3:19 AM
Unknown Object (File)
May 16 2024, 3:19 AM
Unknown Object (File)
May 16 2024, 3:19 AM
Unknown Object (File)
May 8 2024, 9:30 AM
Unknown Object (File)
May 3 2024, 11:09 AM
Unknown Object (File)
May 3 2024, 1:40 AM
Unknown Object (File)
May 1 2024, 11:43 AM
Unknown Object (File)
Apr 13 2024, 9:43 PM
Subscribers

Details

Summary

Though the buffer used by l64a() is initialized with null bytes,
repetetive calls may end up having trailing garbage of previous
invocations because we don't end up terminating the string.

Instead of importing NetBSD's fix, use this opportunity to simplify this
function dramatically, for example by just storing the Base64 character
set in a string. There is also no need to do the bitmasking, as we can
just use the proper integer type from <stdint.h>.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ed retitled this revision from to Let l64a() properly null terminate its result..
ed updated this object.
ed added reviewers: trhodes, jilles.

Revert unneccessary local change.

This revision was automatically updated to reflect the committed changes.