Page MenuHomeFreeBSD

Fix b64_pton output buffer overrun test for exact-sized buffer
ClosedPublic

Authored by emaste on Nov 24 2014, 4:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 23 2024, 1:47 PM
Unknown Object (File)
Dec 24 2023, 10:51 AM
Unknown Object (File)
Dec 24 2023, 10:51 AM
Unknown Object (File)
Dec 23 2023, 8:54 AM
Unknown Object (File)
Dec 11 2023, 9:49 PM
Unknown Object (File)
Aug 1 2023, 10:26 PM
Unknown Object (File)
Jul 28 2023, 12:28 PM
Unknown Object (File)
Jun 27 2023, 4:52 AM
Subscribers

Details

Summary

Submitted by: Ted Unangst
Obtained from: OpenBSD

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to Fix b64_pton output buffer overrun test for exact-sized buffer.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added a reviewer: trasz.

For posterity, Ted's note to freebsd-hackers@:

From inspection, it appears FreeBSD's libc base64.c will sometimes erroneously fail to decode a base64 string into a precisely sized buffer. The overflow check is a little too greedy. The same bug was fixed in OpenBSD; it would be helpful if FreeBSD adopted the fix as well. :)

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/net/base64.c.diff?r1=1.6&r2=1.7

loos added a reviewer: loos.
loos added a subscriber: loos.

I can easily reproduce the problem and the patch does fix it.

Please, go ahead.

This revision is now accepted and ready to land.Nov 25 2014, 1:32 PM

I don't see anything wrong with the patch, but my understanding of this code is rather poor.

trasz edited edge metadata.
emaste updated this revision to Diff 2546.

Closed by commit rS275060 (authored by @emaste).