mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Sync OpenBSD patchset 570:
Change paranoia check to check for <= 0 and to avoid warning.
This commit is contained in:
		| @@ -1,4 +1,4 @@ | ||||
| /* $Id: cmd-load-buffer.c,v 1.13 2009-11-28 14:54:12 tcunha Exp $ */ | ||||
| /* $Id: cmd-load-buffer.c,v 1.14 2009-11-28 14:55:22 tcunha Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> | ||||
| @@ -66,8 +66,8 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) | ||||
| 		ctx->error(ctx, "%s: %s", data->arg, strerror(errno)); | ||||
| 		goto error; | ||||
| 	} | ||||
| 	if (sb.st_size > SIZE_MAX) { | ||||
| 		ctx->error(ctx, "%s: file too large", data->arg); | ||||
| 	if (sb.st_size <= 0 || (uintmax_t) sb.st_size > SIZE_MAX) { | ||||
| 		ctx->error(ctx, "%s: file empty or too large", data->arg); | ||||
| 		goto error; | ||||
| 	} | ||||
| 	psize = (size_t) sb.st_size; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tiago Cunha
					Tiago Cunha