mirror of
https://github.com/linux-can/can-utils.git
synced 2026-11-04 15:31:10 +01:00
isobusfs: cli: use htole16() for the path name length in requests
The Change Current Directory and Open File requests assigned the path name length to the little endian name_len element without conversion, which leads to wrong values on big endian hosts. Use htole16() as it is already done in the other requests. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
@@ -43,7 +43,7 @@ int isobusfs_cli_ccd_req(struct isobusfs_priv *priv, const char *name,
|
|||||||
req->tan = isobusfs_cli_get_next_tan(priv);
|
req->tan = isobusfs_cli_get_next_tan(priv);
|
||||||
|
|
||||||
memcpy(&req->name[0], name, name_len);
|
memcpy(&req->name[0], name, name_len);
|
||||||
req->name_len = name_len;
|
req->name_len = htole16(name_len);
|
||||||
|
|
||||||
if (padding_size) {
|
if (padding_size) {
|
||||||
/* Fill the rest of the res structure with 0xff */
|
/* Fill the rest of the res structure with 0xff */
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ int isobusfs_cli_fa_of_req(struct isobusfs_priv *priv, const char *name,
|
|||||||
req->tan = isobusfs_cli_get_next_tan(priv);
|
req->tan = isobusfs_cli_get_next_tan(priv);
|
||||||
req->flags = flags;
|
req->flags = flags;
|
||||||
memcpy(&req->name[0], name, name_len);
|
memcpy(&req->name[0], name, name_len);
|
||||||
req->name_len = name_len;
|
req->name_len = htole16(name_len);
|
||||||
|
|
||||||
if (padding_size) {
|
if (padding_size) {
|
||||||
/* Fill the rest of the res structure with 0xff */
|
/* Fill the rest of the res structure with 0xff */
|
||||||
|
|||||||
Reference in New Issue
Block a user