diff --git a/lib/c/2014/labcomm_encoder.c b/lib/c/2014/labcomm_encoder.c index 7abf032f939d46c46c47b64376e43da29b0991cb..65ddf6df0abb5d28871f213976996e6854f921f1 100644 --- a/lib/c/2014/labcomm_encoder.c +++ b/lib/c/2014/labcomm_encoder.c @@ -410,7 +410,11 @@ int labcomm_internal_encode( index = labcomm_get_local_index(signature); length = (signature->encoded_size(value)); labcomm_scheduler_writer_lock(e->scheduler); - result = labcomm_writer_start(e->writer, e->writer->action_context, + if (! LABCOMM_SIGNATURE_ARRAY_GET(e->registered, int, index, 0)) { + result = -EINVAL; + goto no_end; + } + result = labcomm_writer_start(e->writer, e->writer->action_context, index, signature, value); if (result == -EALREADY) { result = 0; goto no_end; } if (result != 0) { goto out; }