Check for the pointers before dereference them. Found by Coverity Scan on xine-lib.

This commit is contained in:
flameeyes
2006-09-26 22:21:09 +00:00
parent 232b7e8edc
commit 932617cf75

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660_fs.c,v 1.36 2006/06/02 21:54:21 gmerlin Exp $ $Id: iso9660_fs.c,v 1.37 2006/09/26 22:21:09 flameeyes Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004, 2005, 2006 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005, 2006 Rocky Bernstein <rocky@panix.com>
@@ -50,7 +50,7 @@
#include <stdio.h> #include <stdio.h>
static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.36 2006/06/02 21:54:21 gmerlin Exp $"; static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.37 2006/09/26 22:21:09 flameeyes Exp $";
/* Implementation of iso9660_t type */ /* Implementation of iso9660_t type */
struct _iso9660_s { struct _iso9660_s {
@@ -1239,12 +1239,14 @@ iso9660_ifs_stat_translate (iso9660_t *p_iso, const char psz_path[])
CdioList_t * CdioList_t *
iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[], bool b_mode2) iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[], bool b_mode2)
{ {
generic_img_private_t *p_env;
iso9660_stat_t *p_stat; iso9660_stat_t *p_stat;
generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env;
if (!p_cdio) return NULL; if (!p_cdio) return NULL;
if (!psz_path) return NULL; if (!psz_path) return NULL;
p_env = (generic_img_private_t *) p_cdio->env;
p_stat = iso9660_fs_stat (p_cdio, psz_path); p_stat = iso9660_fs_stat (p_cdio, psz_path);
if (!p_stat) return NULL; if (!p_stat) return NULL;