From dd113de85af565be92305b9bfc5e536bd9272a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 26 Sep 2006 22:23:51 +0000 Subject: Check pointers before dereferencing them. Found by Coverity Scan CID 255. Fixed upstream too. CVS patchset: 8310 CVS date: 2006/09/26 22:23:51 --- src/input/vcd/libcdio/iso9660_fs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/input/vcd/libcdio/iso9660_fs.c b/src/input/vcd/libcdio/iso9660_fs.c index d4ba945c0..4a18c99b9 100644 --- a/src/input/vcd/libcdio/iso9660_fs.c +++ b/src/input/vcd/libcdio/iso9660_fs.c @@ -1,5 +1,5 @@ /* - $Id: iso9660_fs.c,v 1.4 2006/06/10 00:21:51 dgp85 Exp $ + $Id: iso9660_fs.c,v 1.5 2006/09/26 22:23:51 dgp85 Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2003, 2004 Rocky Bernstein @@ -51,7 +51,7 @@ #include -static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.4 2006/06/10 00:21:51 dgp85 Exp $"; +static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.5 2006/09/26 22:23:51 dgp85 Exp $"; /* Implementation of iso9660_t type */ struct _iso9660 { @@ -1053,11 +1053,13 @@ iso9660_ifs_stat_translate (iso9660_t *p_iso, const char pathname[]) CdioList * iso9660_fs_readdir (CdIo *p_cdio, const char pathname[], bool b_mode2) { + generic_img_private_t *p_env; iso9660_stat_t *p_stat; - generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env; if (!p_cdio) return NULL; - if (!pathname) return NULL; + if (!psz_path) return NULL; + + p_env = (generic_img_private_t *) p_cdio->env; p_stat = iso9660_fs_stat (p_cdio, pathname); if (!p_stat) return NULL; -- cgit v1.2.3