Skip to content

Commit aeb27e6

Browse files
committed
gip_send_pkt: Only copy data if non-NULL.
This will, currently, never happen because gip_send_pkt is only called with NULL data when hdr->packet_length <= GIP_PKT_MAX_LENGTH. It's a bit weird but gip_send_pkt_simple does it the same way. Not my prefered solution but works fine for now. Fixes #28.
1 parent 3ac2494 commit aeb27e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bus/protocol.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@ static int gip_send_pkt(struct gip_client *client,
379379
if (err)
380380
return err;
381381

382-
memcpy(client->chunk_buf_in->data, data, hdr->chunk_offset);
382+
if (data)
383+
memcpy(client->chunk_buf_in->data, data, hdr->chunk_offset);
383384

384385
return 0;
385386
}

0 commit comments

Comments
 (0)