Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 14 Feb 2018 21:07:07 +0100
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Re: fwrite() - possible division by zero

On Wed, Feb 14, 2018 at 02:48:14PM -0500, Andrew Bell wrote:
> Why not early return if size == 0 and avoid the call to __fwritex
> altogether?
> 

Because it's a rare corner case? Here, there's also locking correctness
to consider: fwrite() has to block until f is unlocked, irrespective of
parameters. So there's no real benefit to doing an early return.

Ciao,
Markus

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ