Skip to content

Commit

Permalink
In newcat.c check LEVEL values to ensure they are in the range 0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mdblack98 committed Feb 19, 2021
1 parent 555bf9d commit 6a3b28e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rigs/yaesu/newcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -3474,6 +3474,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
RETURNFUNC(-RIG_ENAVAIL);
}
if (val.f > 1.0) RETURNFUNC(-RIG_EINVAL);

fpf = newcat_scale_float(255, val.f);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AG%c%03d%c", main_sub_vfo, fpf,
Expand Down Expand Up @@ -3643,6 +3644,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
newcat_get_mode(rig, vfo, &mode, &width);
}

if (val.f > 1.0) RETURNFUNC(-RIG_EINVAL);
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101
|| is_ftdx10)
{
Expand Down Expand Up @@ -4196,6 +4198,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
RETURNFUNC(-RIG_ENAVAIL);
}

if (val.f > 1.0) RETURNFUNC(-RIG_EINVAL);
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101
|| is_ftdx10)
{
Expand Down

0 comments on commit 6a3b28e

Please sign in to comment.