-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Description
To start an SDO upload, the buffer size must be specified in COCSdoRequestUpload.
CO_ERR COCSdoRequestUpload(CO_CSDO *csdo,
uint32_t key,
uint8_t *buf,
uint32_t size,
CO_CSDO_CALLBACK_T callback,
uint32_t timeout)For uploading null-terminated strings the transferred object size depends on the position of the Nul terminator. Without knowing the exact string size in advance, the upload will fail.
I adapted the size check obj_size == csdo->Tfer.Size to obj_size <= csdo->Tfer.Size in COCSdoInitUploadSegmented to overcome this issue.
static CO_ERR COCSdoInitUploadSegmented(CO_CSDO *csdo)
{
...
/* verify size, Idx, Sub */
if ((obj_size <= csdo->Tfer.Size) &&
(Idx == csdo->Tfer.Idx) &&
(Sub == csdo->Tfer.Sub)) {
...
}
...
}Is this modification permissible or are there side effects?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels