X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mutt_sasl.c;h=6bc3a295606612f546c60c7ccf2fb846e2b99ea1;hp=757f316c7c071e16fc932db31e08ed94ff72bc90;hb=42a4f6bf2d89d9c898c3fbdd849815b79130d631;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/mutt_sasl.c b/mutt_sasl.c index 757f316..6bc3a29 100644 --- a/mutt_sasl.c +++ b/mutt_sasl.c @@ -1,19 +1,10 @@ /* + * Copyright notice from original mutt: * Copyright (C) 2000-5 Brendan Cully - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ /* common SASL helper routines */ @@ -27,6 +18,8 @@ #include "mutt_sasl.h" #include "mutt_socket.h" +#include "lib/mem.h" + #ifdef USE_SASL2 #include #include @@ -138,7 +131,7 @@ static int iptostring (const struct sockaddr *addr, socklen_t addrlen, if (ret) return getnameinfo_err (ret); - if (outlen < strlen (hbuf) + strlen (pbuf) + 2) + if (outlen < safe_strlen (hbuf) + safe_strlen (pbuf) + 2) return SASL_BUFOVER; snprintf (out, outlen, "%s;%s", hbuf, pbuf); @@ -406,7 +399,7 @@ int mutt_sasl_interact (sasl_interact_t * interaction) if (mutt_get_field (prompt, resp, sizeof (resp), 0)) return SASL_FAIL; - interaction->len = mutt_strlen (resp) + 1; + interaction->len = safe_strlen (resp) + 1; interaction->result = safe_malloc (interaction->len); memcpy (interaction->result, resp, interaction->len); @@ -508,7 +501,7 @@ static int mutt_sasl_cb_authname (void *context, int id, const char **result, *result = account->user; if (len) - *len = strlen (*result); + *len = safe_strlen (*result); return SASL_OK; } @@ -529,7 +522,7 @@ static int mutt_sasl_cb_pass (sasl_conn_t * conn, void *context, int id, if (mutt_account_getpass (account)) return SASL_FAIL; - len = strlen (account->pass); + len = safe_strlen (account->pass); *psecret = (sasl_secret_t *) safe_malloc (sizeof (sasl_secret_t) + len); (*psecret)->len = len;