diff options
author | Miles Bader <miles@gnu.org> | 1997-08-18 17:40:08 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-08-18 17:40:08 +0000 |
commit | 7461f926cf97bb398752db17ceb517e93ce5f901 (patch) | |
tree | 226d9bd9ef56103db88b159bc0639bb5596d97eb /libftpconn | |
parent | 21ff436b6391bfd1287dbd0d78cc905007ba3f92 (diff) |
(ftp_conn_append_name, ftp_conn_basename):
Make sure CONN's SYSHOOKS field is valid before using it.
Diffstat (limited to 'libftpconn')
-rw-r--r-- | libftpconn/fname.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libftpconn/fname.c b/libftpconn/fname.c index 7f5959d3..afa0852b 100644 --- a/libftpconn/fname.c +++ b/libftpconn/fname.c @@ -30,7 +30,10 @@ ftp_conn_append_name (struct ftp_conn *conn, const char *dir, const char *name, char **composite) { - if (conn->syshooks.append_name) + error_t err = ftp_conn_validate_syshooks (conn); + if (err) + return err; + else if (conn->syshooks.append_name) return (*conn->syshooks.append_name) (conn, dir, name, composite); else return EOPNOTSUPP; @@ -43,9 +46,13 @@ ftp_conn_append_name (struct ftp_conn *conn, error_t ftp_conn_basename (struct ftp_conn *conn, const char *composite, char **base) { + error_t err = ftp_conn_validate_syshooks (conn); + + if (err) + return err; + if (conn->syshooks.basename) { - error_t err; size_t in_size = strlen (composite) + 1; char *in = strdup (composite), *out = in; |