diff options
author | Eduardo Chappa <chappa@washington.edu> | 2014-04-25 17:31:25 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2014-04-25 17:31:25 -0600 |
commit | e797af007ccac26651f003bcead095f79994d5a0 (patch) | |
tree | b291d66106dcbfba990b6a8f4f9d0986fb76abe1 /alpine/mailcmd.c | |
parent | 06525250787f8f774afa7f25901a8a805f2a29db (diff) | |
download | alpine-e797af007ccac26651f003bcead095f79994d5a0.tar.xz |
* When downloading a signed message, and processing it, we use
body->nested.part instead of b->nested.part in the
do_detached_signature_verify function, and save its body and mime
headers in create_local_cache. Now all signed messages should
verify correctly.
* Protect against potential crash bug in write_passfile function by
checking if text != NULL. text can only be null if there are no
passwords to save. We assume we could get write_passfile called
with null arguments, so this is just to protect that.
* Add handling of corner cases to several functions by initializing some
variables. Reported and patched by James Jerkins.
* When selecting the certificate/key pair to encrypt/decrypt the password
file choose it in this order:
- if -pwdcertdir is given look for certificates there, if nothing
there, we bail out;
- otherwise we look in the default directory, if anything there
and it matches to be a key/cert pair, we use it;
- otherwise we check if smime_init() has been called. If not
we call it;
- we check if a key/cert pair has been found with smime initialized,
if so, use it and copy it to the default directory;
- if not, check if there is anything in the default smime directories
(.alpine-smime/private and .alpine-smime/public), and in this
case copy it to the default.
- otherwise we bail. We will eventually create a certificate/key
pair for the user;
- finally, if we called smime_init(), we call smime_deinit().
Throughout this process, if smime_init() was not called before
we tried to get the cert/key pair we exit this process without
ps_global->smime->inited set, so that other process that need
to call smime_init() get the right structure initialized. This is
done because we might pick a cert/key pair to decrypt the password
file.
Diffstat (limited to 'alpine/mailcmd.c')
-rw-r--r-- | alpine/mailcmd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/alpine/mailcmd.c b/alpine/mailcmd.c index 0ea1617c..bde099c6 100644 --- a/alpine/mailcmd.c +++ b/alpine/mailcmd.c @@ -438,7 +438,7 @@ view_text: : (in_index == View) ? MH_ANYTHD : MH_NONE); if(i == mn_get_cur(msgmap)){ - PINETHRD_S *thrd, *topthrd; + PINETHRD_S *thrd = NULL, *topthrd = NULL; if(THRD_INDX_ENABLED()){ mn_dec_cur(stream, msgmap, MH_ANYTHD); @@ -5537,20 +5537,20 @@ broach_folder(int qline, int allow_list, int *notrealinbox, CONTEXT_S **context) * newfolder, including content and size. f2 is copy of f1 * that has to freed. Sigh! */ - f3 = cpystr(newfolder); + f3 = (unsigned char *) cpystr(newfolder); f1 = fs_get(sizeof(newfolder)); f2 = folder_name_decoded(f3); if(f3) fs_give((void **)&f3); - strncpy(f1, f2, sizeof(newfolder)); + strncpy((char *)f1, (char *)f2, sizeof(newfolder)); f1[sizeof(newfolder)-1] = '\0'; if(f2) fs_give((void **)&f2); flags = OE_APPEND_CURRENT; rc = optionally_enter(f1, qline, 0, sizeof(newfolder), - prompt, ekey, help, &flags); + (char *) prompt, ekey, help, &flags); f2 = folder_name_encoded(f1); - strncpy(newfolder, f2, sizeof(newfolder)); + strncpy(newfolder, (char *)f2, sizeof(newfolder)); if(f1) fs_give((void **)&f1); if(f2) fs_give((void **)&f2); |