On Thu, Aug 05, 2010 at 12:39:52AM -0400, Reinhard Tartler wrote:
> Hi Folks,
> 
> This is a patch from Adrian Knoth <[email protected]> to fix a
> segfault on empty playlists.
> 
> This is Debian Bug: http://bugs.debian.org/591525
> 
> Index: playtree.c
> ===================================================================
> --- playtree.c        (revision 31912)
> +++ playtree.c        (working copy)
> @@ -223,6 +223,13 @@
>    assert(pt->entry_type == PLAY_TREE_ENTRY_NODE);
>  #endif
>  
> +  /* Roughly validate input data. Both, pt and child are going to be
> +   * dereferenced, hence assure they're not NULL.
> +   */
> +  if (NULL == pt || NULL == child) {
> +      return;
> +  }
> +

Checking for NULL after dereferencing makes no sense, even if the
dereferencing is inside an assert.
Apart from that, pt and child are not _input_ data, they are
MPlayer-internal data, it is very likely the validation
should happen far earlier.



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to