diff options
author | Theodore Tso <tytso@mit.edu> | 1998-02-14 03:24:40 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1998-02-14 03:24:40 +0000 |
commit | 9cb15d118e17697d8b969a05b1065f20a4c84aff (patch) | |
tree | 6e57f96b0a514f5f395774b990afee4e87cb80be /src | |
parent | f632fc2945811325756dd043fd1f9d4a62bb51dc (diff) | |
download | krb5-9cb15d118e17697d8b969a05b1065f20a4c84aff.zip krb5-9cb15d118e17697d8b969a05b1065f20a4c84aff.tar.gz krb5-9cb15d118e17697d8b969a05b1065f20a4c84aff.tar.bz2 |
Applied lxs's changes to make ftpd safe for systems where
sizeof(off_t) > sizeof(int).
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10456 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/appl/gssftp/ftpd/ChangeLog | 5 | ||||
-rw-r--r-- | src/appl/gssftp/ftpd/ftpd.c | 18 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/appl/gssftp/ftpd/ChangeLog b/src/appl/gssftp/ftpd/ChangeLog index 5794fc7..a635851 100644 --- a/src/appl/gssftp/ftpd/ChangeLog +++ b/src/appl/gssftp/ftpd/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 13 22:23:34 1998 Theodore Y. Ts'o <tytso@mit.edu> + + * ftpd.c: Applied lxs's changes to make ftpd safe for systems + where sizeof(off_t) > sizeof(int). + Fri Feb 13 15:31:46 1998 Theodore Ts'o <tytso@rsts-11.mit.edu> * Makefile.in (thisconfigdir), configure.in: Point the diff --git a/src/appl/gssftp/ftpd/ftpd.c b/src/appl/gssftp/ftpd/ftpd.c index d3d7855..68668fa 100644 --- a/src/appl/gssftp/ftpd/ftpd.c +++ b/src/appl/gssftp/ftpd/ftpd.c @@ -204,7 +204,18 @@ int swaitmax = SWAITMAX; int swaitint = SWAITINT; void lostconn(), myoob(); -FILE *getdatasock(), *dataconn(); +FILE *getdatasock(); +#if defined(__STDC__) +/* + * The following prototypes must be ANSI for systems for which + * sizeof(off_t) > sizeof(int) to prevent stack overflow problems + */ +FILE *dataconn(char *name, off_t size, char *mode); +void send_data(FILE *instr, FILE *outstr, off_t blksize); +#else +void send_data(); +FILE *dataconn(); +#endif #ifdef SETPROCTITLE char **Argv = NULL; /* pointer to argument vector */ @@ -1052,7 +1063,8 @@ dataconn(name, size, mode) file_size = size; byte_count = 0; if (size != (off_t) -1) - (void) sprintf (sizebuf, " (%ld bytes)", size); + /* cast size to long in case sizeof(off_t) > sizeof(long) */ + (void) sprintf (sizebuf, " (%ld bytes)", (long)size); else (void) strcpy(sizebuf, ""); if (pdata >= 0) { @@ -1142,7 +1154,7 @@ secure_error(fmt, p1, p2, p3, p4, p5) * * NB: Form isn't handled. */ -send_data(instr, outstr, blksize) +void send_data(instr, outstr, blksize) FILE *instr, *outstr; off_t blksize; { |