Use strncopy rather than strcpy in get_hwinfo. Make sure all strings have
null byte at the end.
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
$Id: bincue.c,v 1.17 2006/02/10 18:04:17 rocky Exp $
|
$Id: bincue.c,v 1.18 2006/02/13 01:43:29 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2002, 2003, 2004, 2005, 2006
|
||||||
|
Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
cue parsing routine adapted from cuetools
|
cue parsing routine adapted from cuetools
|
||||||
Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
|
Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
|
||||||
@@ -26,7 +27,7 @@
|
|||||||
(*.cue).
|
(*.cue).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: bincue.c,v 1.17 2006/02/10 18:04:17 rocky Exp $";
|
static const char _rcsid[] = "$Id: bincue.c,v 1.18 2006/02/13 01:43:29 rocky Exp $";
|
||||||
|
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
#include "cdio_assert.h"
|
#include "cdio_assert.h"
|
||||||
@@ -953,9 +954,15 @@ cdio_get_default_device_bincue(void)
|
|||||||
static bool
|
static bool
|
||||||
get_hwinfo_bincue ( const CdIo_t *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
|
get_hwinfo_bincue ( const CdIo_t *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
|
||||||
{
|
{
|
||||||
strcpy(hw_info->psz_vendor, "libcdio");
|
strncpy(hw_info->psz_vendor, "libcdio",
|
||||||
strcpy(hw_info->psz_model, "CDRWIN");
|
sizeof(hw_info->psz_model)-1);
|
||||||
strcpy(hw_info->psz_revision, CDIO_VERSION);
|
hw_info->psz_vendor[sizeof(hw_info->psz_vendor)-1] = '\0';
|
||||||
|
strncpy(hw_info->psz_model, "CDRWIN",
|
||||||
|
sizeof(hw_info->psz_model)-1);
|
||||||
|
hw_info->psz_model[sizeof(hw_info->psz_model)-1] = '\0';
|
||||||
|
strncpy(hw_info->psz_revision, CDIO_VERSION,
|
||||||
|
sizeof(hw_info->psz_revision)-1);
|
||||||
|
hw_info->psz_revision[sizeof(hw_info->psz_revision)-1] = '\0';
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cdrdao.c,v 1.18 2005/06/08 08:07:00 rocky Exp $
|
$Id: cdrdao.c,v 1.19 2006/02/13 01:43:29 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004, 2005, 2006 Rocky Bernstein <rocky@panix.com>
|
||||||
toc reading routine adapted from cuetools
|
toc reading routine adapted from cuetools
|
||||||
Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
|
Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
(*.cue).
|
(*.cue).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: cdrdao.c,v 1.18 2005/06/08 08:07:00 rocky Exp $";
|
static const char _rcsid[] = "$Id: cdrdao.c,v 1.19 2006/02/13 01:43:29 rocky Exp $";
|
||||||
|
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
#include "cdio_assert.h"
|
#include "cdio_assert.h"
|
||||||
@@ -1144,11 +1144,16 @@ cdio_get_default_device_cdrdao(void)
|
|||||||
static bool
|
static bool
|
||||||
get_hwinfo_cdrdao ( const CdIo_t *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
|
get_hwinfo_cdrdao ( const CdIo_t *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
|
||||||
{
|
{
|
||||||
strcpy(hw_info->psz_vendor, "libcdio");
|
strncpy(hw_info->psz_vendor, "libcdio",
|
||||||
strcpy(hw_info->psz_model, "cdrdao");
|
sizeof(hw_info->psz_model)-1);
|
||||||
strcpy(hw_info->psz_revision, CDIO_VERSION);
|
hw_info->psz_vendor[sizeof(hw_info->psz_vendor)-1] = '\0';
|
||||||
|
strncpy(hw_info->psz_model, "cdrdao",
|
||||||
|
sizeof(hw_info->psz_model)-1);
|
||||||
|
hw_info->psz_model[sizeof(hw_info->psz_model)-1] = '\0';
|
||||||
|
strncpy(hw_info->psz_revision, CDIO_VERSION,
|
||||||
|
sizeof(hw_info->psz_revision)-1);
|
||||||
|
hw_info->psz_revision[sizeof(hw_info->psz_revision)-1] = '\0';
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: nrg.c,v 1.21 2006/02/12 10:48:11 rocky Exp $
|
$Id: nrg.c,v 1.22 2006/02/13 01:43:29 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003, 2004, 2005, 2006 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003, 2004, 2005, 2006 Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 2001, 2003 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2001, 2003 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
#include "_cdio_stdio.h"
|
#include "_cdio_stdio.h"
|
||||||
#include "nrg.h"
|
#include "nrg.h"
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: nrg.c,v 1.21 2006/02/12 10:48:11 rocky Exp $";
|
static const char _rcsid[] = "$Id: nrg.c,v 1.22 2006/02/13 01:43:29 rocky Exp $";
|
||||||
|
|
||||||
nero_id_t nero_id;
|
nero_id_t nero_id;
|
||||||
nero_dtype_t nero_dtype;
|
nero_dtype_t nero_dtype;
|
||||||
@@ -1113,9 +1113,15 @@ cdio_get_default_device_nrg(void)
|
|||||||
static bool
|
static bool
|
||||||
get_hwinfo_nrg ( const CdIo *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
|
get_hwinfo_nrg ( const CdIo *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
|
||||||
{
|
{
|
||||||
strcpy(hw_info->psz_vendor, "libcdio");
|
strncpy(hw_info->psz_vendor, "libcdio",
|
||||||
strcpy(hw_info->psz_model, "Nero");
|
sizeof(hw_info->psz_model)-1);
|
||||||
strcpy(hw_info->psz_revision, CDIO_VERSION);
|
hw_info->psz_vendor[sizeof(hw_info->psz_vendor)-1] = '\0';
|
||||||
|
strncpy(hw_info->psz_model, "Nero",
|
||||||
|
sizeof(hw_info->psz_model)-1);
|
||||||
|
hw_info->psz_model[sizeof(hw_info->psz_model)-1] = '\0';
|
||||||
|
strncpy(hw_info->psz_revision, CDIO_VERSION,
|
||||||
|
sizeof(hw_info->psz_revision)-1);
|
||||||
|
hw_info->psz_revision[sizeof(hw_info->psz_revision)-1] = '\0';
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user