=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-load-buffer.c,v retrieving revision 1.9 retrieving revision 1.10 diff -c -r1.9 -r1.10 *** src/usr.bin/tmux/cmd-load-buffer.c 2009/11/26 22:28:24 1.9 --- src/usr.bin/tmux/cmd-load-buffer.c 2009/11/26 22:32:00 1.10 *************** *** 1,4 **** ! /* $OpenBSD: cmd-load-buffer.c,v 1.9 2009/11/26 22:28:24 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha --- 1,4 ---- ! /* $OpenBSD: cmd-load-buffer.c,v 1.10 2009/11/26 22:32:00 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha *************** *** 66,73 **** 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); goto error; } psize = (size_t) sb.st_size; --- 66,73 ---- ctx->error(ctx, "%s: %s", data->arg, strerror(errno)); goto error; } ! 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;