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
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
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_
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