aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorJulien Chaffraix <julien.chaffraix@gmail.com>2010-11-13 12:01:33 -0800
committerJulien Chaffraix <julien.chaffraix@gmail.com>2010-11-13 14:12:43 -0800
commit8d59d69449c2a86c478699a50d920541aa106201 (patch)
tree15ef9751b2d92dbd511c95d22d70ca61bdeec674 /lib/ftp.c
parent465865c3cb316907ca1c1ea813cf426a2366dce4 (diff)
security: tighten enum protection_level usage.
While changing Curl_sec_read_msg to accept an enum protection_level instead of an int, I went ahead and fixed the usage of the associated fields. Some code was assuming that prot_clear == 0. Fixed those to use the proper value. Added assertions prior to any code that would set the protection level.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 416e5ecfa..22589355f 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3784,11 +3784,13 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
for(;;) {
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
+ DEBUGASSERT(prot_cmd > prot_none && prot_cmd < prot_last);
conn->data_prot = prot_cmd;
#endif
res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len,
&bytes_written);
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
+ DEBUGASSERT(data_sec > prot_none && data_sec < prot_last);
conn->data_prot = data_sec;
#endif