mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2023-10-10 13:37:43 +02:00
prevent memory fault from card name if file name is given
This commit is contained in:
parent
8e39e291a0
commit
072689735c
@ -34,9 +34,9 @@ static int yesno()
|
|||||||
|
|
||||||
static int update_flash(struct ddflash *ddf)
|
static int update_flash(struct ddflash *ddf)
|
||||||
{
|
{
|
||||||
char *fname;
|
char *fname, *default_fname;
|
||||||
int res, stat = 0;
|
int res, stat = 0;
|
||||||
char *name;
|
char *name = 0, *dname;
|
||||||
|
|
||||||
switch (ddf->id.device) {
|
switch (ddf->id.device) {
|
||||||
case 0x300:
|
case 0x300:
|
||||||
@ -111,8 +111,9 @@ static int update_flash(struct ddflash *ddf)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fname = ddf->fname;
|
fname = ddf->fname;
|
||||||
|
default_fname = devid2fname(ddf->id.device, &name);
|
||||||
if (!fname)
|
if (!fname)
|
||||||
fname = devid2fname(ddf->id.device, &name);
|
fname = default_fname;
|
||||||
if (name)
|
if (name)
|
||||||
printf("Card: %s\n", name);
|
printf("Card: %s\n", name);
|
||||||
if (ddf->flash_name)
|
if (ddf->flash_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user