- (djm) OpenBSD CVS Sync
   - ray@cvs.openbsd.org 2006/09/30 17:48:22
     [sftp.c]
     Clear errno before calling the strtol functions.
     From Paul Stoeber <x0001 at x dot de1 dot cc>.
     OK deraadt@.
diff --git a/sftp.c b/sftp.c
index c018615..a39c782 100644
--- a/sftp.c
+++ b/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>
  *
@@ -977,6 +977,7 @@
 	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) {