summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-08-26 12:12:56 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-08-26 12:12:56 +1000
commit7858726e8a11574f01a888761b60377530c918d2 (patch)
tree1976c8aa30a711a3a72d1a4e2ed23e6371963509
parent600ad8de76e12820ed1ff0db71946b4e03d5349c (diff)
- 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 ba3e56d8d..cb0b2db35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,10 @@
22 - deraadt@cvs.openbsd.org 2003/08/24 17:36:52 22 - deraadt@cvs.openbsd.org 2003/08/24 17:36:52
23 [monitor.c monitor_wrap.c sshconnect2.c] 23 [monitor.c monitor_wrap.c sshconnect2.c]
24 64 bit cleanups; markus ok 24 64 bit cleanups; markus ok
25 - fgsch@cvs.openbsd.org 2003/08/25 08:13:09
26 [sftp-int.c]
27 fix div by zero when listing for filename lengths longer than width.
28 markus@ ok.
25 - (dtucker) [Makefile.in acconfig.h auth-krb5.c auth-pam.c auth-pam.h 29 - (dtucker) [Makefile.in acconfig.h auth-krb5.c auth-pam.c auth-pam.h
26 configure.ac defines.h gss-serv-krb5.c session.c ssh-gss.h sshconnect1.c 30 configure.ac defines.h gss-serv-krb5.c session.c ssh-gss.h sshconnect1.c
27 sshconnect2.c] Add Portable GSSAPI support, patch by Simon Wilkinson. 31 sshconnect2.c] Add Portable GSSAPI support, patch by Simon Wilkinson.
@@ -897,4 +901,4 @@
897 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. 901 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
898 Report from murple@murple.net, diagnosis from dtucker@zip.com.au 902 Report from murple@murple.net, diagnosis from dtucker@zip.com.au
899 903
900$Id: ChangeLog,v 1.2912 2003/08/26 02:10:48 dtucker Exp $ 904$Id: ChangeLog,v 1.2913 2003/08/26 02:12:56 dtucker Exp $
diff --git a/sftp-int.c b/sftp-int.c
index 73653b7e0..94299aa43 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -25,7 +25,7 @@
25/* XXX: recursive operations */ 25/* XXX: recursive operations */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: sftp-int.c,v 1.61 2003/07/19 00:45:53 djm Exp $"); 28RCSID("$OpenBSD: sftp-int.c,v 1.62 2003/08/25 08:13:09 fgsch Exp $");
29 29
30#include "buffer.h" 30#include "buffer.h"
31#include "xmalloc.h" 31#include "xmalloc.h"
@@ -600,6 +600,7 @@ do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
600 width = ws.ws_col; 600 width = ws.ws_col;
601 601
602 columns = width / (m + 2); 602 columns = width / (m + 2);
603 columns = MAX(columns, 1);
603 colspace = width / columns; 604 colspace = width / columns;
604 } 605 }
605 606
@@ -686,6 +687,7 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
686 width = ws.ws_col; 687 width = ws.ws_col;
687 688
688 columns = width / (m + 2); 689 columns = width / (m + 2);
690 columns = MAX(columns, 1);
689 colspace = width / columns; 691 colspace = width / columns;
690 } 692 }
691 693