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 2017-09-07 18:54:54 +00:00
parent daa30798d5
commit 054ccb502d

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;