I have found a buffer overflow in libbsd. Upstream has released 0.8.2 today to fix it.
I think the affected function is rarely used, so I assume impact is relatively limited.
Upstream commit with explanation:
Added 0.8.2 which includes a fix for this.
Arches please test and stablize.
Stable on alpha.
Stable for HPPA.
Stable for PPC64.
Maintainer(s), please cleanup.
Security, please add it to the existing request, or file a new one.
libbsd 0.8.1 and earlier contains a buffer overflow in the function
fgetwln(). An if checks if it is necessary to reallocate memory in the
target buffer. However this check is off by one, therefore an out of
bounds write happens.
@maintainers, still pending cleanup of vulnerable ebuilds. Please let us know when complete or if you are unable to at this time. Thanks.
This issue was resolved and addressed in
GLSA 201607-13 at https://security.gentoo.org/glsa/201607-13
by GLSA coordinator Aaron Bauman (b-man).