From 232b7e8edcd6455bceadbbd2bf9190e6486bda4a Mon Sep 17 00:00:00 2001 From: flameeyes Date: Tue, 26 Sep 2006 22:08:13 +0000 Subject: [PATCH] Check for the validity of the pointer before using strlen on it. Found by Coverity Scan on xine-lib. --- lib/driver/MSWindows/win32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/driver/MSWindows/win32.c b/lib/driver/MSWindows/win32.c index bd9ab571..0f455d06 100644 --- a/lib/driver/MSWindows/win32.c +++ b/lib/driver/MSWindows/win32.c @@ -1,5 +1,5 @@ /* - $Id: win32.c,v 1.35 2006/04/04 02:06:13 rocky Exp $ + $Id: win32.c,v 1.36 2006/09/26 22:08:13 flameeyes Exp $ Copyright (C) 2003, 2004, 2005, 2006 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: win32.c,v 1.35 2006/04/04 02:06:13 rocky Exp $"; +static const char _rcsid[] = "$Id: win32.c,v 1.36 2006/09/26 22:08:13 flameeyes Exp $"; #include #include @@ -834,8 +834,8 @@ cdio_is_device_win32(const char *source_name) { unsigned int len; - len = strlen(source_name); if (NULL == source_name) return false; + len = strlen(source_name); #ifdef HAVE_WIN32_CDROM if ((len == 2) && isalpha(source_name[0])