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)
Thu, Oct 24, 9:44 PM
Unknown Object (File)
Oct 17 2024, 11:17 AM
Unknown Object (File)
Oct 4 2024, 4:00 PM
Unknown Object (File)
Oct 2 2024, 12:10 AM
Unknown Object (File)
Sep 26 2024, 12:50 AM
Unknown Object (File)
Sep 21 2024, 9:11 AM
Unknown Object (File)
Sep 8 2024, 5:42 PM
Unknown Object (File)
Sep 8 2024, 7:55 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).