summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sftp.c
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-09-30 17:48:23 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-09-30 17:48:23 +0000
commit1712168a6ac665f19edb6d85b784cf03df89d00b (patch)
tree37ee55661b3e83ab8c4a02cf12a744d2d4cb2c00 /usr.bin/ssh/sftp.c
parent2089d60b1455bbcc181a25b376999406ea4bccd8 (diff)
Clear errno before calling the strtol functions.
From Paul Stoeber <x0001 at x dot de1 dot cc>. OK deraadt@.
Diffstat (limited to 'usr.bin/ssh/sftp.c')
-rw-r--r--usr.bin/ssh/sftp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index 30358e199c2..804ed487ae6 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.92 2006/09/19 05:52:23 otto Exp $ */
+/* $OpenBSD: sftp.c,v 1.93 2006/09/30 17:48:22 ray Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -965,6 +965,7 @@ parse_args(const char **cpp, int *pflag, int *lflag, int *iflag,
case I_CHOWN:
case I_CHGRP:
/* Get numeric arg (mandatory) */
+ errno = 0;
l = strtol(cp, &cp2, base);
if (cp2 == cp || ((l == LONG_MIN || l == LONG_MAX) &&
errno == ERANGE) || l < 0) {