Re: [pacman-dev] [PATCH] Fix out of boundary reads in pacsort.

2016-06-18 Thread Dave Reisner
On Sat, Jun 18, 2016 at 06:44:01PM +0200, Tobias Stoeckmann wrote: > On Mon, Jun 13, 2016 at 04:01:17PM +1000, Allan McRae wrote: > > Fixing that strndup is preferable. I want to keep the ability to handle > > \0 delimited fields given that is what pacman --machinereadable does > > (despite that o

Re: [pacman-dev] [PATCH] Handle all POSIX compliant systems in mbscasecmp.

2016-06-18 Thread Tobias Stoeckmann
The width of wchar_t is allowed to be of the same width as long, according to standards. The return type of mbscasecmp is int though. On amd64 with a 32 bit int, this means that mbscasecmp can return zero (indicating that strings are equal) even though the input strings differ. Signed-off-by: Tob

Re: [pacman-dev] [PATCH] Fix out of boundary reads in pacsort.

2016-06-18 Thread Tobias Stoeckmann
On Mon, Jun 13, 2016 at 04:01:17PM +1000, Allan McRae wrote: > Fixing that strndup is preferable. I want to keep the ability to handle > \0 delimited fields given that is what pacman --machinereadable does > (despite that option not being ubiquitous at the moment...) If \0 is a valid field _and_

Re: [pacman-dev] [PATCH] Reject files larger than INT_MAX in read_sigfile.

2016-06-18 Thread Tobias Stoeckmann
If signature files are larger than SIZE_MAX, not enough memory could be allocated for this file. The script repo-add rejects files which are larger than 16384 bytes, therefore handle these as errors here, too. While at it, I also rearranged the code to avoid a quite harmless TOCTOU race condition