[FFmpeg-devel] [PATCH] lavu/hash: make all functions work gracefully with NULL.
Michael Niedermayer
michaelni at gmx.at
Mon Apr 21 13:12:03 CEST 2014
On Sun, Apr 20, 2014 at 11:59:08PM +0200, Nicolas George wrote:
> Le primidi 1er floréal, an CCXXII, Michael Niedermayer a écrit :
> > does it allow to simplify any existing code ?
>
> This one, probably not: ignoring errors is still evil, and should be
> discouraged / fixed. I would say it is rather a matter of making bugs
> (unchecked calls) have less serious consequences: empty hashes instead of
> NULL dereference. OTOH, I believe a NULL dereference is not exploitable and
> is detectable immediately, which is good, while an empty hash is hiding the
> bug, and may cause security concerns.
>
> So I do not know if it is a good idea or not. It was just easy to write
> while waiting on compilation.
i think null checks should be added to all free/dealloc functions
so they can saftely be called twice or if initial allocation faild
as well as anything where it simplifies code
for other things i dunno
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140421/ec26f3ac/attachment.asc>
More information about the ffmpeg-devel
mailing list