]> diplodocus.org Git - nmh/blobdiff - sbr/netsec.c
Fix invalid pointer arithmetic.
[nmh] / sbr / netsec.c
index 4b5edcfcd0638fd35ef7d2f70dcec96abf245446..ab49046745bbb4040e3ebb2053749950b323c040 100644 (file)
@@ -881,7 +881,7 @@ netsec_flush(netsec_context *nsc, char **errstr)
 
     if (nsc->ns_snoop) {
        unsigned int snoopoutlen = netoutlen;
-       const char *snoopoutbuf = nsc->ns_outbuffer;
+       const char *snoopoutbuf = (const char *) nsc->ns_outbuffer;
 
        while (snoopoutlen > 0) {
            const char *end = strpbrk(snoopoutbuf, "\r\n");
@@ -913,7 +913,7 @@ netsec_flush(netsec_context *nsc, char **errstr)
 #endif /* TLS_SUPPORT */
            fprintf(stderr, "=> ");
            if (nsc->ns_snoop_cb) {
-               char *ptr;
+               const char *ptr;
                unsigned int cb_len = outlen;
 
                if (nsc->ns_snoop_savebuf) {
@@ -1479,6 +1479,20 @@ netsec_get_sasl_mechanism(netsec_context *nsc)
     return nsc->sasl_chosen_mech;
 }
 
+/*
+ * Return the negotiated SASL strength security factor (SSF)
+ */
+
+int
+netsec_get_sasl_ssf(netsec_context *nsc)
+{
+#ifdef CYRUS_SASL
+    return nsc->sasl_ssf;
+#else /* CYRUS_SASL */
+    return 0;
+#endif /* CYRUS_SASL */
+}
+
 /*
  * Set an OAuth2 service name, if we support it.
  */