Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssh/dist CID 1128376: check ftruncat...



details:   https://anonhg.NetBSD.org/src/rev/524abea31d66
branches:  trunk
changeset: 791281:524abea31d66
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Nov 11 16:46:20 2013 +0000

description:
CID 1128376: check ftruncate result

diffstat:

 crypto/external/bsd/openssh/dist/sftp-client.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 817ea331164e -r 524abea31d66 crypto/external/bsd/openssh/dist/sftp-client.c
--- a/crypto/external/bsd/openssh/dist/sftp-client.c    Mon Nov 11 16:44:43 2013 +0000
+++ b/crypto/external/bsd/openssh/dist/sftp-client.c    Mon Nov 11 16:46:20 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sftp-client.c,v 1.9 2013/11/11 16:43:26 christos Exp $ */
+/*     $NetBSD: sftp-client.c,v 1.10 2013/11/11 16:46:20 christos Exp $        */
 /* $OpenBSD: sftp-client.c,v 1.101.2.1 2013/11/08 01:33:56 djm Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm%openbsd.org@localhost>
@@ -22,7 +22,7 @@
 /* XXX: copy between two remote sites */
 
 #include "includes.h"
-__RCSID("$NetBSD: sftp-client.c,v 1.9 2013/11/11 16:43:26 christos Exp $");
+__RCSID("$NetBSD: sftp-client.c,v 1.10 2013/11/11 16:46:20 christos Exp $");
 #include <sys/types.h>
 #include <sys/poll.h>
 #include <sys/queue.h>
@@ -1212,7 +1212,9 @@
                            "server reordered requests", local_path);
                }
                debug("truncating at %llu", (unsigned long long)highwater);
-               ftruncate(local_fd, highwater);
+               if (ftruncate(local_fd, highwater) == -1) {
+                       error("Unable to truncate \"%s\"", local_path);
+               }
        }
        if (read_error) {
                error("Couldn't read from remote file \"%s\" : %s",



Home | Main Index | Thread Index | Old Index