X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-crypt%2Fcrypt-gpgme.c;h=7e3495be8219ee18d098fbf7265537bf09774230;hp=29a676e0b57ef065e81d2894a63a8aee4a253fa6;hb=f3cbb9f51357972f6e74244494236a41dc4d84cd;hpb=9ed7a487e3a922f2cbb222961c2c9710c3a65f91 diff --git a/lib-crypt/crypt-gpgme.c b/lib-crypt/crypt-gpgme.c index 29a676e..7e3495b 100644 --- a/lib-crypt/crypt-gpgme.c +++ b/lib-crypt/crypt-gpgme.c @@ -467,7 +467,7 @@ static char *data_object_to_tempfile (gpgme_data_t data, FILE ** ret_fp) while ((nread = gpgme_data_read (data, buf, sizeof (buf)))) { if (fwrite (buf, nread, 1, fp) != 1) { - mutt_perror (tempfile); + mutt_perror (_("Can't create temporary file")); m_fclose(&fp); unlink (tempfile); return NULL; @@ -1002,6 +1002,7 @@ static void show_fingerprint (gpgme_key_t key, STATE * state) int i, is_pgp; char *buf, *p; const char *prefix = _("Fingerprint: "); + ssize_t bufsize; if (!key) return; @@ -1010,8 +1011,9 @@ static void show_fingerprint (gpgme_key_t key, STATE * state) return; is_pgp = (key->protocol == GPGME_PROTOCOL_OpenPGP); - buf = xmalloc(m_strlen(prefix) + m_strlen(s) * 4 + 2); - strcpy (buf, prefix); /* __STRCPY_CHECKED__ */ + bufsize = m_strlen(prefix) + m_strlen(s) * 4 + 2; + buf = xmalloc(bufsize); + m_strcpy(buf, bufsize, prefix); p = buf + m_strlen(buf); if (is_pgp && m_strlen(s) == 40) { /* PGP v4 style formatted. */ for (i = 0; *s && s[1] && s[2] && s[3] && s[4]; s += 4, i++) { @@ -3257,15 +3259,15 @@ static crypt_key_t *crypt_select_key (crypt_key_t * keys, helpstr[0] = 0; mutt_make_help (buf, sizeof (buf), _("Exit "), menu_to_use, OP_EXIT); - strcat (helpstr, buf); /* __STRCAT_CHECKED__ */ + m_strcat(helpstr, sizeof(helpstr), buf); mutt_make_help (buf, sizeof (buf), _("Select "), menu_to_use, OP_GENERIC_SELECT_ENTRY); - strcat (helpstr, buf); /* __STRCAT_CHECKED__ */ + m_strcat(helpstr, sizeof(helpstr), buf); mutt_make_help (buf, sizeof (buf), _("Check key "), menu_to_use, OP_VERIFY_KEY); - strcat (helpstr, buf); /* __STRCAT_CHECKED__ */ + m_strcat(helpstr, sizeof(helpstr), buf); mutt_make_help (buf, sizeof (buf), _("Help"), menu_to_use, OP_HELP); - strcat (helpstr, buf); /* __STRCAT_CHECKED__ */ + m_strcat(helpstr, sizeof(helpstr), buf); menu = mutt_new_menu (); menu->max = i; @@ -3707,7 +3709,7 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc, keylist_size += m_strlen(s) + 4 + 1; p_realloc(&keylist, keylist_size); - sprintf (keylist + keylist_used, "%s0x%s%s", /* __SPRINTF_CHECKED__ */ + sprintf (keylist + keylist_used, "%s0x%s%s", keylist_used ? " " : "", s, forced_valid ? "!" : ""); } keylist_used = m_strlen(keylist); @@ -3865,7 +3867,7 @@ static int verify_sender (HEADER * h, gpgme_protocol_t protocol __attribute__((u if (1 && (uid->email[0] == '<') && (uid->email[uid_length - 1] == '>') && (uid_length == sender_length + 2) - && (!strncmp (uid->email + 1, sender->mailbox, sender_length))) + && (!m_strncmp (uid->email + 1, sender->mailbox, sender_length))) ret = 0; } }