-/* $OpenBSD: sftp-client.c,v 1.112 2014/01/16 07:31:09 djm Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.113 2014/01/17 00:21:06 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
local_path, strerror(errno));
goto fail;
}
- if (st.st_size > size) {
+ if (st.st_size < 0) {
+ error("\"%s\" has negative size", local_path);
+ goto fail;
+ }
+ if ((u_int64_t)st.st_size > size) {
error("Unable to resume download of \"%s\": "
"local file is larger than remote", local_path);
fail: