mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-18 11:20:56 +01:00
Change paranoia check to check for <= 0 and to avoid warning.
This commit is contained in:
parent
8cb410c63c
commit
c2eb869f72
@ -66,8 +66,8 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
ctx->error(ctx, "%s: %s", data->arg, strerror(errno));
|
ctx->error(ctx, "%s: %s", data->arg, strerror(errno));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (sb.st_size > SIZE_MAX) {
|
if (sb.st_size <= 0 || (uintmax_t) sb.st_size > SIZE_MAX) {
|
||||||
ctx->error(ctx, "%s: file too large", data->arg);
|
ctx->error(ctx, "%s: file empty or too large", data->arg);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
psize = (size_t) sb.st_size;
|
psize = (size_t) sb.st_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user