Actions
Bug #6264
closedosmo_iofd_write_msgb unconditionally dereferences io_ops.write_cb
Start date:
11/20/2023
Due date:
% Done:
100%
Spec Reference:
Description
int osmo_iofd_write_msgb(struct osmo_io_fd *iofd, struct msgb *msg) { int rc; if (OSMO_UNLIKELY(!iofd->io_ops.write_cb)) { LOGPIO(iofd, LOGL_ERROR, "write_cb not set, Rejecting msgb\n"); return -EINVAL; }
Unlike the sendto variant, there's no OSMO_ASSERT for the correct mode...
int osmo_iofd_sendto_msgb(struct osmo_io_fd *iofd, struct msgb *msg, int sendto_flags, const struct osmo_sockaddr *dest) { int rc; OSMO_ASSERT(iofd->mode == OSMO_IO_FD_MODE_RECVFROM_SENDTO); if (OSMO_UNLIKELY(!iofd->io_ops.sendto_cb)) { LOGPIO(iofd, LOGL_ERROR, "sendto_cb not set, Rejecting msgb\n"); return -EINVAL; }
Related issues
Updated by daniel 17 days ago
- Status changed from In Progress to Resolved
- % Done changed from 60 to 100
Applied in changeset libosmocore|afdfc6a034d0bec95993f29cc712b66288a54cbc.
Actions