ASoC: SOF: ipc3-topology: Correct get_control_data for non bytes payload
Subsystems (3)
Peter Ujfalusi
maintainerPATCH v2 1/1 ASoC: SOF: ipc3-topology: Correct get_control_data for non bytes payload
It is possible to craft a topology where sof_get_control_data() would do out of bounds access because it expects that it is only called when the payload is bytes type.
Confusingly it also handles other types of controls, but the payload parsing implementation is only valid for bytes.
Fix the code to count the non bytes controls and instead of storing a pointer to sof_abi_hdr in sof_widget_data (which is only valid for bytes), store the pointer to the data itself and add a new member to save the size of the data.
In case of non bytes controls we store the pointer to the chanv itself, which is just an array of values at the end.
---
Hi,
changes since v1:
- adjust the payload size for non bytes controls by subtracting the size of the sof_ipc_ctrl_data struct, plus add comment to note this
Regards,
Peter
sound/soc/sof/ipc3-topology.c | 40 ++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 12 deletions(-)
sound/soc/sof/ipc3-topology.c +28 -12
@@ -20,7 +20,8 @@struct sof_widget_data {int ctrl_type;int ipc_cmd; -struct sof_abi_hdr *pdata; +void *pdata; +size_t pdata_size;struct snd_sof_control *control; };
@@ -784,16 +785,29 @@ static int sof_get_control_data(struct snd_soc_component *scomp, } cdata = wdata[i].control->ipc_control_data; - wdata[i].pdata = cdata->data; -if (!wdata[i].pdata) -return -EINVAL ;/* make sure data is valid - data can be updated at runtime */ -if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES && - wdata[i].pdata->magic !=SOF_ABI_MAGIC ) -return -EINVAL ; +if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES ) { +if (!cdata->data) +return -EINVAL ; + +if (cdata->data->magic !=SOF_ABI_MAGIC ) +return -EINVAL ; + + wdata[i].pdata = cdata->data->data; + wdata[i].pdata_size = cdata->data->size; + }else { +/* points to the control data union */ + wdata[i].pdata = cdata->chanv; +/* +* wdata[i].control->size is calculated with struct_size +* and includes the size of struct sof_ipc_ctrl_data +*/ + wdata[i].pdata_size = wdata[i].control->size - +sizeof (struct sof_ipc_ctrl_data ); + } - *size += wdata[i].pdata->size; + *size += wdata[i].pdata_size;/* get data type */ switch (cdata->cmd) {
@@ -876,10 +890,12 @@ static int sof_process_load(struct snd_soc_component *scomp,*/ if (ipc_data_size) {for (i =0 ; i < widget->num_kcontrols; i++) { -memcpy (&process->data[offset], - wdata[i].pdata->data, - wdata[i].pdata->size); - offset += wdata[i].pdata->size; +if (!wdata[i].pdata_size) +continue ; + +memcpy (&process->data[offset], wdata[i].pdata, + wdata[i].pdata_size); + offset += wdata[i].pdata_size; } }
Signature · 1 line
2.36.0
Quoted 11 lines · Peter Ujfalusi
It is possible to craft a topology where
sof_get_control_data()would do out of bounds access because it expects that it is only called when the payload is bytes type.
Confusingly it also handles other types of controls, but the payload parsing implementation is only valid for bytes.Fix the code to count the non bytes controls and instead of storing a pointer to
sof_abi_hdrinsof_widget_data(which is only valid for bytes), store the pointer to the data itself and add a new member to save the size of the data.
Quoted 5 lines
In case of non bytes controls we store the pointer to the chanv itself, which is just an array of values at the end.
Reported-by Sergey Senozhatsky <[email protected]>Signed-off-by Peter Ujfalusi <[email protected]>
Looks good to me. Thank you.
FWIW,
So below is what I ended up with for 5.10. The original patch does not apply cleanly because -stable is missing a number of patches, so I crafted a backport. If it looks OK to you then we probably can send it to stable folks.
--- sound/soc/sof/topology.c | 42 +++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-)
sound/soc/sof/topology.c +29 -13
@@ -50,7 +50,8 @@struct sof_widget_data {int ctrl_type;int ipc_cmd; -struct sof_abi_hdr *pdata; +void *pdata; +size_t pdata_size;struct snd_sof_control *control; };
@@ -2100,6 +2101,7 @@ static int sof_get_control_data(struct snd_soc_component *scomp, size_t *size) {const struct snd_kcontrol_new *kc; +struct sof_ipc_ctrl_data *cdata;struct soc_mixer_control *sm;struct soc_bytes_ext *sbe;struct soc_enum *se;
@@ -2136,16 +2138,28 @@ static int sof_get_control_data(struct snd_soc_component *scomp,return -EINVAL ; } - wdata[i].pdata = wdata[i].control->control_data->data; -if (!wdata[i].pdata) -return -EINVAL ; + cdata = wdata[i].control->control_data; +if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES ) { +if ((void *)cdata->data ==NULL ) +return -EINVAL ; -/* make sure data is valid - data can be updated at runtime */ -if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES && - wdata[i].pdata->magic !=SOF_ABI_MAGIC ) -return -EINVAL ; +if (cdata->data->magic !=SOF_ABI_MAGIC ) +return -EINVAL ; + + wdata[i].pdata = cdata->data; + wdata[i].pdata_size = cdata->data->size; + }else { +/* points to the control data union */ + wdata[i].pdata = cdata->chanv; +/* +* wdata[i].control->size is calculated with struct_size +* and includes the size of struct sof_ipc_ctrl_data +*/ + wdata[i].pdata_size = wdata[i].control->size - +sizeof (struct sof_ipc_ctrl_data ); + } - *size += wdata[i].pdata->size; + *size += wdata[i].pdata_size;/* get data type */ switch (wdata[i].control->cmd) {
@@ -2236,10 +2250,12 @@ static int sof_process_load(struct snd_soc_component *scomp, int index,*/ if (ipc_data_size) {for (i =0 ; i < widget->num_kcontrols; i++) { -memcpy (&process->data + offset, - wdata[i].pdata->data, - wdata[i].pdata->size); - offset += wdata[i].pdata->size; +if (!wdata[i].pdata_size) +continue ; + +memcpy (&process->data[offset], wdata[i].pdata, + wdata[i].pdata_size); + offset += wdata[i].pdata_size; } }
Signature · 1 line
2.31.0
Péter Ujfalusi
maintainerQuoted 56 lines · Sergey Senozhatsky
Quoted 11 lines · Peter Ujfalusi
It is possible to craft a topology where
sof_get_control_data()would do out of bounds access because it expects that it is only called when the payload is bytes type.
Confusingly it also handles other types of controls, but the payload parsing implementation is only valid for bytes.Fix the code to count the non bytes controls and instead of storing a pointer to
sof_abi_hdrinsof_widget_data(which is only valid for bytes), store the pointer to the data itself and add a new member to save the size of the data.Quoted 5 lines
In case of non bytes controls we store the pointer to the chanv itself, which is just an array of values at the end.
Reported-by Sergey Senozhatsky <[email protected]>Signed-off-by Peter Ujfalusi <[email protected]>Looks good to me. Thank you.
FWIW,Reviewed-by Sergey Senozhatsky <[email protected]>Tested-by Sergey Senozhatsky <[email protected]>So below is what I ended up with for 5.10. The original patch does not apply cleanly because -stable is missing a number of patches, so I crafted a backport. If it looks OK to you then we probably can send it to stable folks.
--- sound/soc/sof/topology.c | 42 +++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-)sound/soc/sof/topology.c +3
-1@@ -50,7 +50,8 @@struct sof_widget_data {int ctrl_type;int ipc_cmd; -struct sof_abi_hdr *pdata; +void *pdata; +size_t pdata_size;struct snd_sof_control *control; };@@ -2100,6 +2101,7 @@ static int sof_get_control_data(struct snd_soc_component *scomp, size_t *size) {const struct snd_kcontrol_new *kc; +struct sof_ipc_ctrl_data *cdata;struct soc_mixer_control *sm;struct soc_bytes_ext *sbe;struct soc_enum *se;
sound/soc/sof/topology.c static int sof_get_control_data(struct snd_soc_component *scomp, · line 2143
Quoted 9 lines
sound/soc/sof/topology.c +3
-3@@ -2136,16 +2138,28 @@ static int sof_get_control_data(struct snd_soc_component *scomp,return -EINVAL ; } - wdata[i].pdata = wdata[i].control->control_data->data; -if (!wdata[i].pdata) -return -EINVAL ; + cdata = wdata[i].control->control_data; +if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES ) { +if ((void *)cdata->data ==NULL )
Is there a need for casting it to void*?
sound/soc/sof/topology.c static int sof_get_control_data(struct snd_soc_component *scomp, · line 2149
Quoted 10 lines
sound/soc/sof/topology.c +5
-4+return -EINVAL ; -/* make sure data is valid - data can be updated at runtime */ -if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES && - wdata[i].pdata->magic !=SOF_ABI_MAGIC ) -return -EINVAL ; +if (cdata->data->magic !=SOF_ABI_MAGIC ) +return -EINVAL ; + + wdata[i].pdata = cdata->data;
you want to save the cdata->data->data, so w/o the abi header stuff.
Quoted 34 lines
sound/soc/sof/topology.c +18
-5+ wdata[i].pdata_size = cdata->data->size; + }else { +/* points to the control data union */ + wdata[i].pdata = cdata->chanv; +/* +* wdata[i].control->size is calculated with struct_size +* and includes the size of struct sof_ipc_ctrl_data +*/ + wdata[i].pdata_size = wdata[i].control->size - +sizeof (struct sof_ipc_ctrl_data ); + } - *size += wdata[i].pdata->size; + *size += wdata[i].pdata_size;/* get data type */ switch (wdata[i].control->cmd) {@@ -2236,10 +2250,12 @@ static int sof_process_load(struct snd_soc_component *scomp, int index,*/ if (ipc_data_size) {for (i =0 ; i < widget->num_kcontrols; i++) { -memcpy (&process->data + offset, - wdata[i].pdata->data, - wdata[i].pdata->size); - offset += wdata[i].pdata->size; +if (!wdata[i].pdata_size) +continue ; + +memcpy (&process->data[offset], wdata[i].pdata, + wdata[i].pdata_size); + offset += wdata[i].pdata_size; } }
Signature · 1 line
Péter
Quoted 12 lines · Péter Ujfalusi
Quoted 12 lines
(quoted diff) +1
-0@@ -2100,6 +2101,7 @@ static int sof_get_control_data(struct snd_soc_component *scomp, size_t *size) { const struct snd_kcontrol_new *kc; + struct sof_ipc_ctrl_data *cdata; struct soc_mixer_control *sm; struct soc_bytes_ext *sbe; struct soc_enum *se;@@ -2136,16 +2138,28 @@ static int sof_get_control_data(struct snd_soc_component *scomp, return -EINVAL; }
Quoted 8 lines
Review static int sof_get_control_data(struct snd_soc_component *scomp, · line 2143
Quoted 6 lines
(quoted diff) +3
-3- wdata[i].pdata = wdata[i].control->control_data->data; - if (!wdata[i].pdata) - return -EINVAL; + cdata = wdata[i].control->control_data; + if (widget->dobj.widget.kcontrol_type[i] == SND_SOC_TPLG_TYPE_BYTES) { + if ((void *)cdata->data == NULL)Is there a need for casting it to void*?
clang appears to be unhappy otherwise.
error: comparison of array 'cdata->data' equal to a null pointer is always false
Changing this into if (!cdata->data) is a little bit better as now 'always false' becomes 'always true'
error: address of array 'cdata->data' will always evaluate to 'true'
Quoted 12 lines
Review static int sof_get_control_data(struct snd_soc_component *scomp, · line 2149
Quoted 10 lines
(quoted diff) +5
-4+ return -EINVAL; - /* make sure data is valid - data can be updated at runtime */ - if (widget->dobj.widget.kcontrol_type[i] == SND_SOC_TPLG_TYPE_BYTES && - wdata[i].pdata->magic != SOF_ABI_MAGIC) - return -EINVAL; + if (cdata->data->magic != SOF_ABI_MAGIC) + return -EINVAL; + + wdata[i].pdata = cdata->data;you want to save the
cdata->data->data, so w/o the abi header stuff.
Oh... good catch!
I used wdata[i].control->control_data->data for tests, converted this to cdata the very last moment.
So something like this then
--- sound/soc/sof/topology.c | 42 +++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-)
sound/soc/sof/topology.c +29 -13
@@ -50,7 +50,8 @@struct sof_widget_data {int ctrl_type;int ipc_cmd; -struct sof_abi_hdr *pdata; +void *pdata; +size_t pdata_size;struct snd_sof_control *control; };
@@ -2100,6 +2101,7 @@ static int sof_get_control_data(struct snd_soc_component *scomp, size_t *size) {const struct snd_kcontrol_new *kc; +struct sof_ipc_ctrl_data *cdata;struct soc_mixer_control *sm;struct soc_bytes_ext *sbe;struct soc_enum *se;
@@ -2136,16 +2138,28 @@ static int sof_get_control_data(struct snd_soc_component *scomp,return -EINVAL ; } - wdata[i].pdata = wdata[i].control->control_data->data; -if (!wdata[i].pdata) -return -EINVAL ; + cdata = wdata[i].control->control_data; +if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES ) { +if ((void *)cdata->data ==NULL ) +return -EINVAL ; -/* make sure data is valid - data can be updated at runtime */ -if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES && - wdata[i].pdata->magic !=SOF_ABI_MAGIC ) -return -EINVAL ; +if (cdata->data->magic !=SOF_ABI_MAGIC ) +return -EINVAL ; + + wdata[i].pdata = cdata->data->data; + wdata[i].pdata_size = cdata->data->size; + }else { +/* points to the control data union */ + wdata[i].pdata = cdata->chanv; +/* +* wdata[i].control->size is calculated with struct_size +* and includes the size of struct sof_ipc_ctrl_data +*/ + wdata[i].pdata_size = wdata[i].control->size - +sizeof (struct sof_ipc_ctrl_data ); + } - *size += wdata[i].pdata->size; + *size += wdata[i].pdata_size;/* get data type */ switch (wdata[i].control->cmd) {
@@ -2236,10 +2250,12 @@ static int sof_process_load(struct snd_soc_component *scomp, int index,*/ if (ipc_data_size) {for (i =0 ; i < widget->num_kcontrols; i++) { -memcpy (&process->data + offset, - wdata[i].pdata->data, - wdata[i].pdata->size); - offset += wdata[i].pdata->size; +if (!wdata[i].pdata_size) +continue ; + +memcpy (&process->data[offset], wdata[i].pdata, + wdata[i].pdata_size); + offset += wdata[i].pdata_size; } }
Signature · 1 line
2.31.0
Péter Ujfalusi
maintainerQuoted 22 lines · Sergey Senozhatsky
Quoted 12 lines · Péter Ujfalusi
Quoted 12 lines
sound/soc/sof/topology.c +1
-0@@ -2100,6 +2101,7 @@ static int sof_get_control_data(struct snd_soc_component *scomp, size_t *size) {const struct snd_kcontrol_new *kc; +struct sof_ipc_ctrl_data *cdata;struct soc_mixer_control *sm;struct soc_bytes_ext *sbe;struct soc_enum *se;@@ -2136,16 +2138,28 @@ static int sof_get_control_data(struct snd_soc_component *scomp,return -EINVAL ; }Quoted 8 lines
sound/soc/sof/topology.c static int sof_get_control_data(struct snd_soc_component *scomp, · line 2143
Quoted 6 lines
sound/soc/sof/topology.c +3
-3- wdata[i].pdata = wdata[i].control->control_data->data; -if (!wdata[i].pdata) -return -EINVAL ; + cdata = wdata[i].control->control_data; +if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES ) { +if ((void *)cdata->data ==NULL )Is there a need for casting it to void*?
Quoted 8 lines
clang appears to be unhappy otherwise.
error: comparison of array 'cdata->data' equal to a null pointer is always falseChanging this into
if (!cdata->data)is a little bit better as now 'always false' becomes 'always true'error: address of array 'cdata->data' will always evaluate to 'true'
Hrm, uhm. clang is right. The check is (and was) bogus...
cdata->data is a pointer (to cdata->data[0]) which is always:
cdata + sizeof(struct sof_ipc_ctrl_data).
Checking if it is NULL or not is irrelevant and wrong. If we do not have additional data then cdata->data points to memory which is outside of the struct and it can be random data (might be 0, might not be).
I think we can just drop this check as we would not be here if additional data was not allocated for the payload prior?
Quoted 101 lines
Quoted 13 lines
sound/soc/sof/topology.c static int sof_get_control_data(struct snd_soc_component *scomp,
Quoted 11 lines
sound/soc/sof/topology.c +5
-4+return -EINVAL ; -/* make sure data is valid - data can be updated at runtime */ -if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES && - wdata[i].pdata->magic !=SOF_ABI_MAGIC ) -return -EINVAL ; +if (cdata->data->magic !=SOF_ABI_MAGIC ) +return -EINVAL ; + + wdata[i].pdata = cdata->data;you want to save the
cdata->data->data, so w/o the abi header stuff.Oh... good catch!
I used
wdata[i].control->control_data->datafor tests, converted this to cdata the very last moment.So something like this then
--- sound/soc/sof/topology.c | 42 +++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-)sound/soc/sof/topology.c +29
-13@@ -50,7 +50,8 @@struct sof_widget_data {int ctrl_type;int ipc_cmd; -struct sof_abi_hdr *pdata; +void *pdata; +size_t pdata_size;struct snd_sof_control *control; };@@ -2100,6 +2101,7 @@ static int sof_get_control_data(struct snd_soc_component *scomp, size_t *size) {const struct snd_kcontrol_new *kc; +struct sof_ipc_ctrl_data *cdata;struct soc_mixer_control *sm;struct soc_bytes_ext *sbe;struct soc_enum *se;@@ -2136,16 +2138,28 @@ static int sof_get_control_data(struct snd_soc_component *scomp,return -EINVAL ; } - wdata[i].pdata = wdata[i].control->control_data->data; -if (!wdata[i].pdata) -return -EINVAL ; + cdata = wdata[i].control->control_data; +if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES ) { +if ((void *)cdata->data ==NULL ) +return -EINVAL ; -/* make sure data is valid - data can be updated at runtime */ -if (widget->dobj.widget.kcontrol_type[i] ==SND_SOC_TPLG_TYPE_BYTES && - wdata[i].pdata->magic !=SOF_ABI_MAGIC ) -return -EINVAL ; +if (cdata->data->magic !=SOF_ABI_MAGIC ) +return -EINVAL ; + + wdata[i].pdata = cdata->data->data; + wdata[i].pdata_size = cdata->data->size; + }else { +/* points to the control data union */ + wdata[i].pdata = cdata->chanv; +/* +* wdata[i].control->size is calculated with struct_size +* and includes the size of struct sof_ipc_ctrl_data +*/ + wdata[i].pdata_size = wdata[i].control->size - +sizeof (struct sof_ipc_ctrl_data ); + } - *size += wdata[i].pdata->size; + *size += wdata[i].pdata_size;/* get data type */ switch (wdata[i].control->cmd) {@@ -2236,10 +2250,12 @@ static int sof_process_load(struct snd_soc_component *scomp, int index,*/ if (ipc_data_size) {for (i =0 ; i < widget->num_kcontrols; i++) { -memcpy (&process->data + offset, - wdata[i].pdata->data, - wdata[i].pdata->size); - offset += wdata[i].pdata->size; +if (!wdata[i].pdata_size) +continue ; + +memcpy (&process->data[offset], wdata[i].pdata, + wdata[i].pdata_size); + offset += wdata[i].pdata_size; } }
Signature · 1 line
Péter
Quoted 9 lines · Péter Ujfalusi
Quoted 8 lines
clang appears to be unhappy otherwise.
error: comparison of array 'cdata->data' equal to a null pointer is always falseChanging this into
if (!cdata->data)is a little bit better as now 'always false' becomes 'always true'error: address of array 'cdata->data' will always evaluate to 'true'
Quoted 7 lines
Hrm, uhm. clang is right. The check is (and was) bogus...
cdata->datais a pointer (to cdata->data[0]) which is always:
cdata +sizeof(struct sof_ipc_ctrl_data).
Checking if it is NULL or not is irrelevant and wrong. If we do not have additional data thencdata->datapoints to memory which is outside of the struct and it can be random data (might be 0, might not be).
Yeah to be honest that's what I'm thinking too.
Does sof_ipc_ctrl_data have to be a var-sized structure? Or can that union hold pointers that are allocated separately?
scontrol->data = kzalloc(sizeof sof_ipc_ctrl_data); scontrol->data->chan = kzalloc(sizeof chan * mc->num_channels)
Quoted 2 lines
I think we can just drop this check as we would not be here if additional data was not allocated for the payload prior?
I don't have enough knowledge of this code. ->data check doesn't do what it is expected to do so removing it shouldn't do harm.
Péter Ujfalusi
maintainerQuoted 18 lines · Sergey Senozhatsky
Quoted 9 lines · Péter Ujfalusi
Quoted 8 lines
clang appears to be unhappy otherwise.
error: comparison of array 'cdata->data' equal to a null pointer is always falseChanging this into
if (!cdata->data)is a little bit better as now 'always false' becomes 'always true'error: address of array 'cdata->data' will always evaluate to 'true'Quoted 7 lines
Hrm, uhm. clang is right. The check is (and was) bogus...
cdata->datais a pointer (to cdata->data[0]) which is always:
cdata +sizeof(struct sof_ipc_ctrl_data).
Checking if it is NULL or not is irrelevant and wrong. If we do not have additional data thencdata->datapoints to memory which is outside of the struct and it can be random data (might be 0, might not be).
Quoted 7 lines
Yeah to be honest that's what I'm thinking too.
Does
sof_ipc_ctrl_datahave to be a var-sized structure? Or can that union hold pointers that are allocated separately?scontrol->data = kzalloc(sizeof sof_ipc_ctrl_data); scontrol->data->chan = kzalloc(sizeof chan * mc->num_channels)
Unfortunately no, the data/chanv/compv needs to be flexible array as it is the IPC message itself.
Quoted 6 lines
Quoted 3 lines
I think we can just drop this check as we would not be here if additional data was not allocated for the payload prior?
I don't have enough knowledge of this code. ->data check doesn't do what it is expected to do so removing it shouldn't do harm.
Let me quickly send v3 with dropped cdata->data check.
Signature · 1 line
Péter
Quoted 10 lines · Péter Ujfalusi
Quoted 10 lines
Quoted 7 lines
Hrm, uhm. clang is right. The check is (and was) bogus...
cdata->datais a pointer (to cdata->data[0]) which is always:
cdata +sizeof(struct sof_ipc_ctrl_data).
Checking if it is NULL or not is irrelevant and wrong. If we do not have additional data thencdata->datapoints to memory which is outside of the struct and it can be random data (might be 0, might not be).Yeah to be honest that's what I'm thinking too.
Quoted 8 lines
Quoted 5 lines
Does
sof_ipc_ctrl_datahave to be a var-sized structure? Or can that union hold pointers that are allocated separately?scontrol->data = kzalloc(sizeof sof_ipc_ctrl_data); scontrol->data->chan = kzalloc(sizeof chan * mc->num_channels)Unfortunately no, the data/chanv/compv needs to be flexible array as it is the IPC message itself.
That's what I suspected.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
I think we can just drop this check as we would not be here if additional data was not allocated for the payload prior?
I don't have enough knowledge of this code. ->data check doesn't do what it is expected to do so removing it shouldn't do harm.
Let me quickly send v3 with dropped
cdata->datacheck.
OK. I'll remove if from the backport, run another test and will call it a day. As you can guess I was puzzled by that ->data check but it's another very long day in the office for me and in the end I just dropped the ball and decide to suppress clang warning instead. Very smart! (NO). My bad. (YES).