diff options
author | Sebastian Kuzminsky <seb@highlab.com> | 2014-04-22 00:04:50 -0600 |
---|---|---|
committer | Sebastian Kuzminsky <seb@highlab.com> | 2014-04-22 00:04:50 -0600 |
commit | 8880d3ad47e8fcc83d5406e8421b04dc1fcc4dc2 (patch) | |
tree | 268f4898f59eec609491566c76e4eb0bf18a4bf5 | |
parent | 6133e30a92989751be76aebd6ce8b489237e29f9 (diff) | |
download | linuxcnc-8880d3ad47e8fcc83d5406e8421b04dc1fcc4dc2.tar.gz linuxcnc-8880d3ad47e8fcc83d5406e8421b04dc1fcc4dc2.zip |
mux_generic: add missing return value check
-rw-r--r-- | src/hal/components/mux_generic.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/hal/components/mux_generic.c b/src/hal/components/mux_generic.c index 9a61da210..598362e3c 100644 --- a/src/hal/components/mux_generic.c +++ b/src/hal/components/mux_generic.c @@ -174,6 +174,9 @@ int rtapi_app_main(void){ } retval = rtapi_snprintf(hal_name, HAL_NAME_LEN, "mux-gen.%02i", i); + if (retval >= HAL_NAME_LEN) { + goto fail0; + } if (inst->in_type == HAL_FLOAT || inst->out_type == HAL_FLOAT) { retval = hal_export_funct(hal_name, write_fp, inst, 1, 0, comp_id); if (retval < 0) { @@ -218,6 +221,9 @@ int rtapi_app_main(void){ for (p = 0; p < inst->size; p++) { retval = rtapi_snprintf(hal_name, HAL_NAME_LEN, "mux-gen.%02i.in-%s-%02i", i, types[inst->in_type], p); + if (retval >= HAL_NAME_LEN) { + goto fail0; + } retval = hal_pin_new(hal_name, inst->in_type, HAL_IN, (void**)&(inst->inputs[p]), comp_id); if (retval != 0) { @@ -250,6 +256,9 @@ int rtapi_app_main(void){ //output pins retval = rtapi_snprintf(hal_name, HAL_NAME_LEN, "mux-gen.%02i.out-%s", i, types[inst->out_type]); + if (retval >= HAL_NAME_LEN) { + goto fail0; + } retval = hal_pin_new(hal_name, inst->out_type, HAL_OUT, (void**)&(inst->output), comp_id); if (retval != 0) { |