IPC: Bug in ipc_send_data()

25 views
Skip to first unread message

Sperrus

unread,
Jun 13, 2025, 12:11:34 PM6/13/25
to swupdate
Hi Stefano,

while trying to stream an image to swupdate via the ipc api I discovered a bug in ipc_send_data (ipc/network_ipc.c):

'ret' is subtracted from the remaining length but the original ''size' is still passed to write(). If write() returned a short count, invalid data would be written in the next loop iteration.

A simple fix would be something like this:
- ret = write(connfd, buf, (size_t)size);
+ ret = write(connfd, buf, (size_t)len);

I dont have git send-email set up yet to submit my own patch, so I hope this is ok for now.

Thanks,
Eric

Reply all
Reply to author
Forward
0 new messages