diff --git a/rpcrig/rpcrigd.c b/rpcrig/rpcrigd.c index ac8b1bc5d..9876fab05 100644 --- a/rpcrig/rpcrigd.c +++ b/rpcrig/rpcrigd.c @@ -91,7 +91,9 @@ int set_conf(RIG *my_rig, char *conf_parms) while (p && *p != '\0') { /* FIXME: left hand value of = cannot be null */ q = strchr(p, '='); - if (q) *q++ = '\0'; + if ( !q ) + return RIG_EINVAL; + *q++ = '\0'; n = strchr(q, ','); if (n) *n++ = '\0'; diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 281236f2a..cc6e3f8bc 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -661,7 +661,9 @@ int set_conf(RIG *my_rig, char *conf_parms) while (p && *p != '\0') { /* FIXME: left hand value of = cannot be null */ q = strchr(p, '='); - if (q) *q++ = '\0'; + if ( !q ) + return RIG_EINVAL; + *q++ = '\0'; n = strchr(q, ','); if (n) *n++ = '\0'; diff --git a/tests/rigmem.c b/tests/rigmem.c index 22ab43a38..cf3c33bc3 100644 --- a/tests/rigmem.c +++ b/tests/rigmem.c @@ -347,7 +347,9 @@ int set_conf(RIG *rig, char *conf_parms) while (p && *p != '\0') { /* FIXME: left hand value of = cannot be null */ q = strchr(p, '='); - if (q) *q++ = '\0'; + if ( !q ) + return RIG_EINVAL; + *q++ = '\0'; n = strchr(q, ','); if (n) *n++ = '\0'; diff --git a/tests/rigsmtr.c b/tests/rigsmtr.c index 623cffea9..cdb4f1216 100644 --- a/tests/rigsmtr.c +++ b/tests/rigsmtr.c @@ -355,7 +355,9 @@ int set_conf_rig(RIG *rig, char *conf_parms) while (p && *p != '\0') { /* FIXME: left hand value of = cannot be null */ q = strchr(p, '='); - if (q) *q++ = '\0'; + if ( !q ) + return RIG_EINVAL; + *q++ = '\0'; n = strchr(q, ','); if (n) *n++ = '\0'; diff --git a/tests/rigswr.c b/tests/rigswr.c index b8988c2fb..5c4f578d0 100644 --- a/tests/rigswr.c +++ b/tests/rigswr.c @@ -303,7 +303,9 @@ int set_conf(RIG *rig, char *conf_parms) while (p && *p != '\0') { /* FIXME: left hand value of = cannot be null */ q = strchr(p, '='); - if (q) *q++ = '\0'; + if ( !q ) + return RIG_EINVAL; + *q++ = '\0'; n = strchr(q, ','); if (n) *n++ = '\0'; diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 9600a910a..553ddad11 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -555,7 +555,9 @@ int set_conf(ROT *my_rot, char *conf_parms) while (p && *p != '\0') { /* FIXME: left hand value of = cannot be null */ q = strchr(p, '='); - if (q) *q++ = '\0'; + if ( !q ) + return RIG_EINVAL; + *q++ = '\0'; n = strchr(q, ','); if (n) *n++ = '\0';