Date: Mon, 10 Jul 2017 21:11:20 +0300 (MSK) From: Alexander Monakov <amonakov@...ras.ru> To: musl@...ts.openwall.com Subject: Re: [RFC PATCH] fix OOB reads in Xbyte_memmem On Fri, 30 Jun 2017, Alexander Monakov wrote: > uint32_t nw = n<<24 | n<<16 | n<<8 | n; > uint32_t hw = h<<24 | h<<16 | h<<8 | h; ^^^^^^^^ Such shifts can invoke UB by shifting 1 into the sign bit. It's easily amended by making the shift happen in an unsigned type; I'd suggest something like 'n*1u<<24 | ...' (I've checked that this does not appear to thwart bswap recognition in GCC) I assume this would need to be a separate patch, we desired at all. Alexander
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.