X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/0a032eea07f6d77ac6ea4d5a39c9491c34358058..d205d39a3f7207c9fefec53677226eb0ffad9966:/sbr/netsec.c?ds=sidebyside diff --git a/sbr/netsec.c b/sbr/netsec.c index e64fde0c..a64743aa 100644 --- a/sbr/netsec.c +++ b/sbr/netsec.c @@ -1,5 +1,4 @@ -/* - * netsec.c -- Network security routines for handling protocols that +/* netsec.c -- Network security routines for handling protocols that * require SASL and/or TLS. * * This code is Copyright (c) 2016, by the authors of nmh. See the @@ -392,7 +391,7 @@ netsec_read(netsec_context *nsc, void *buffer, size_t size, char **errstr) * assume here that this has something in it. */ - retlen = size > nsc->ns_inbuflen ? nsc->ns_inbuflen : size; + retlen = min(size, nsc->ns_inbuflen); memcpy(buffer, nsc->ns_inptr, retlen); @@ -1016,7 +1015,7 @@ netsec_set_sasl_params(netsec_context *nsc, const char *service, /* * According to the RFC, mechanisms can only be uppercase letter, numbers, - * and a hypen or underscore. So make sure we uppercase any letters + * and a hyphen or underscore. So make sure we uppercase any letters * in case the user passed in lowercase. */ @@ -1436,7 +1435,7 @@ netsec_set_tls(netsec_context *nsc, int tls, int noverify, char **errstr) #ifdef TLS_SUPPORT if (tls) { SSL *ssl; - BIO *rbio, *wbio, *ssl_bio;; + BIO *rbio, *wbio, *ssl_bio; if (! tls_initialized) { SSL_library_init();