Fix an incorrectly used conditional causing a stack buffer overflow.

Reported by:	Thomas Jarosch of Intra2net AG
Reviewed by:	emaste, jhb
Security:	CVE-2017-1000249
This commit is contained in:
Gordon Tetlow 2017-09-07 18:54:54 +00:00
parent c0cd38223c
commit 367cf59651
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323278

View file

@ -509,7 +509,7 @@ do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
size_t noff, size_t doff, int *flags)
{
if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 &&
type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) {
type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) {
uint8_t desc[20];
const char *btype;
uint32_t i;