summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordtucker <dtucker>2003-08-26 02:12:56 +0000
committerdtucker <dtucker>2003-08-26 02:12:56 +0000
commit5365eb213818b5d4cef36174c56be011939e2a4a (patch)
tree1f8a38e9b0237995d18a958787a2c7caf6a575d6
parent1e280d5b335eb96bfa98fdda540c87651107ee74 (diff)
downloadopenssh-5365eb213818b5d4cef36174c56be011939e2a4a.tar.gz
- fgsch@cvs.openbsd.org 2003/08/25 08:13:09
[sftp-int.c] fix div by zero when listing for filename lengths longer than width. markus@ ok.
-rw-r--r--ChangeLog6
-rw-r--r--sftp-int.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ba3e56d8..cb0b2db3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,10 @@
- deraadt@cvs.openbsd.org 2003/08/24 17:36:52
[monitor.c monitor_wrap.c sshconnect2.c]
64 bit cleanups; markus ok
+ - fgsch@cvs.openbsd.org 2003/08/25 08:13:09
+ [sftp-int.c]
+ fix div by zero when listing for filename lengths longer than width.
+ markus@ ok.
- (dtucker) [Makefile.in acconfig.h auth-krb5.c auth-pam.c auth-pam.h
configure.ac defines.h gss-serv-krb5.c session.c ssh-gss.h sshconnect1.c
sshconnect2.c] Add Portable GSSAPI support, patch by Simon Wilkinson.
@@ -897,4 +901,4 @@
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
Report from murple@murple.net, diagnosis from dtucker@zip.com.au
-$Id: ChangeLog,v 1.2912 2003/08/26 02:10:48 dtucker Exp $
+$Id: ChangeLog,v 1.2913 2003/08/26 02:12:56 dtucker Exp $
diff --git a/sftp-int.c b/sftp-int.c
index 73653b7e..94299aa4 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -25,7 +25,7 @@
/* XXX: recursive operations */
#include "includes.h"
-RCSID("$OpenBSD: sftp-int.c,v 1.61 2003/07/19 00:45:53 djm Exp $");
+RCSID("$OpenBSD: sftp-int.c,v 1.62 2003/08/25 08:13:09 fgsch Exp $");
#include "buffer.h"
#include "xmalloc.h"
@@ -600,6 +600,7 @@ do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
width = ws.ws_col;
columns = width / (m + 2);
+ columns = MAX(columns, 1);
colspace = width / columns;
}
@@ -686,6 +687,7 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
width = ws.ws_col;
columns = width / (m + 2);
+ columns = MAX(columns, 1);
colspace = width / columns;
}