]> Pileus Git - ~andy/fetchmail/blobdiff - gssapi.c
First round ofmlong-delayed bug fixes.
[~andy/fetchmail] / gssapi.c
index cfc16d27022ecd84da1b26aad05534f3d7c499ea..2769ca467b9042d8a55510c78bb0e78fd694af1b 100644 (file)
--- a/gssapi.c
+++ b/gssapi.c
@@ -120,6 +120,8 @@ int do_gssauth(int sock, char *command, char *hostname, char *username)
                return result;
            }
            request_buf.length = from64tobits(buf2, buf1 + 2, sizeof(buf2));
+           if (request_buf.length == -1)       /* in case of bad data */
+               request_buf.length = 0;
            request_buf.value = buf2;
            sec_token = &request_buf;
         }
@@ -132,6 +134,8 @@ int do_gssauth(int sock, char *command, char *hostname, char *username)
         return result;
 
     request_buf.length = from64tobits(buf2, buf1 + 2, sizeof(buf2));
+    if (request_buf.length == -1)      /* in case of bad data */
+       request_buf.length = 0;
     request_buf.value = buf2;
 
     maj_stat = gss_unwrap(&min_stat, context,