patch-lib_socket_c 1.8 KB

12345678910111213141516171819202122232425262728293031
  1. --- libnfs-libnfs-6.0.2.orig/lib/socket.c 2024-12-14 09:03:11.000000000 +0100
  2. +++ libnfs-libnfs-6.0.2/lib/socket.c 2026-07-09 23:14:51.875631318 +0200
  3. @@ -583,8 +583,8 @@ rpc_read_from_socket(struct rpc_context
  4. }
  5. if (!rpc->is_server_context) {
  6. rpc->rm_xid[0] = count;
  7. - rpc->rm_xid[1] = ntohl(*(uint32_t *)&buf[0]);
  8. - rpc->pdu = rpc_find_pdu(rpc, ntohl(*(uint32_t *)&buf[0]));
  9. + rpc->rm_xid[1] = ntohl(*(uint32_t *)(void *)&buf[0]);
  10. + rpc->pdu = rpc_find_pdu(rpc, ntohl(*(uint32_t *)(void *)&buf[0]));
  11. if (rpc->pdu == NULL) {
  12. rpc_set_error(rpc, "Failed to match incoming PDU/XID."
  13. " Ignoring PDU");
  14. @@ -796,7 +796,7 @@ rpc_read_from_socket(struct rpc_context
  15. }
  16. /* Copy the next 4 bytes into inbuf */
  17. - *((uint32_t *)rpc->inbuf) = htonl(rpc->rm_xid[1]);
  18. + *((uint32_t *)(void *)rpc->inbuf) = htonl(rpc->rm_xid[1]);
  19. /* but set inpos to 0, we will update it above
  20. * that we have already read these 4 bytes in
  21. @@ -858,7 +858,7 @@ rpc_read_from_socket(struct rpc_context
  22. * If the READ failed, bail out here as there is no
  23. * data.
  24. */
  25. - const READ3res *res = (READ3res *) rpc->pdu->zdr_decode_buf;
  26. + const READ3res *res = (READ3res *)(void *) rpc->pdu->zdr_decode_buf;
  27. if (res->status != NFS3_OK) {
  28. goto payload_finished;
  29. }