forked from Mirrors/btrfs-progs
btrfs-progs: send-stream: change length type to unsigned
The command length is unsigned, use the right type, also to make the length checks work. Signed-off-by: David Sterba <dsterba@suse.com>master
parent
23ac27781e
commit
2513dfed8f
|
@ -71,11 +71,11 @@ static int read_cmd(struct btrfs_send_stream *sctx)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int cmd;
|
int cmd;
|
||||||
int cmd_len;
|
u32 cmd_len;
|
||||||
int tlv_type;
|
int tlv_type;
|
||||||
int tlv_len;
|
int tlv_len;
|
||||||
char *data;
|
char *data;
|
||||||
int pos;
|
u32 pos;
|
||||||
struct btrfs_tlv_header *tlv_hdr;
|
struct btrfs_tlv_header *tlv_hdr;
|
||||||
u32 crc;
|
u32 crc;
|
||||||
u32 crc2;
|
u32 crc2;
|
||||||
|
@ -98,7 +98,7 @@ static int read_cmd(struct btrfs_send_stream *sctx)
|
||||||
|
|
||||||
if (cmd_len + sizeof(*sctx->cmd_hdr) >= sizeof(sctx->read_buf)) {
|
if (cmd_len + sizeof(*sctx->cmd_hdr) >= sizeof(sctx->read_buf)) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
error("command length %d too big for buffer %zu",
|
error("command length %u too big for buffer %zu",
|
||||||
cmd_len, sizeof(sctx->read_buf));
|
cmd_len, sizeof(sctx->read_buf));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue