diff options
author | Eduardo Chappa <chappa@washington.edu> | 2021-05-08 21:01:02 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2021-05-08 21:01:02 -0600 |
commit | b5eb45a153202d72aeb48de1149e7c74aef979fd (patch) | |
tree | 1fbc156a717e7963cd0c02fd7352bc801949c550 /alpine | |
parent | 2f953255a8c494e3033015eb064c6ecace9ffeda (diff) | |
download | alpine-b5eb45a153202d72aeb48de1149e7c74aef979fd.tar.xz |
Diffstat (limited to 'alpine')
-rw-r--r-- | alpine/adrbkcmd.c | 7 | ||||
-rw-r--r-- | alpine/alpine.c | 2 | ||||
-rw-r--r-- | alpine/folder.c | 2 | ||||
-rw-r--r-- | alpine/imap.c | 5 | ||||
-rw-r--r-- | alpine/mailcmd.c | 18 | ||||
-rw-r--r-- | alpine/mailindx.c | 8 | ||||
-rw-r--r-- | alpine/mailview.c | 6 | ||||
-rw-r--r-- | alpine/osdep/debuging.c | 2 | ||||
-rw-r--r-- | alpine/osdep/fltrname.c | 2 | ||||
-rw-r--r-- | alpine/remote.c | 6 | ||||
-rw-r--r-- | alpine/reply.c | 6 | ||||
-rw-r--r-- | alpine/roleconf.c | 13 | ||||
-rw-r--r-- | alpine/send.c | 13 |
13 files changed, 49 insertions, 41 deletions
diff --git a/alpine/adrbkcmd.c b/alpine/adrbkcmd.c index c22ca31..94d9077 100644 --- a/alpine/adrbkcmd.c +++ b/alpine/adrbkcmd.c @@ -2185,11 +2185,12 @@ convert_abook_to_remote(struct pine *ps, PerAddrBook *pab, char *rem_folder_pref if(*rem_abook){ file = cpystr(rem_abook); if(pab->abnick){ - nick = (char *)fs_get((MAX(strlen(pab->abnick),strlen("Address Book"))+8) * sizeof(char)); - snprintf(nick, sizeof(nick), "Remote %s", + int len = MAX(strlen(pab->abnick),strlen("Address Book"))+8; + nick = (char *)fs_get(len * sizeof(char)); + snprintf(nick, len, "Remote %s", (pab->abnick && !strcmp(pab->abnick, DF_ADDRESSBOOK)) ? "Address Book" : pab->abnick); - nick[sizeof(nick)-1] = '\0'; + nick[len-1] = '\0'; } else nick = cpystr("Remote Address Book"); diff --git a/alpine/alpine.c b/alpine/alpine.c index c2b7b37..cb75260 100644 --- a/alpine/alpine.c +++ b/alpine/alpine.c @@ -1098,7 +1098,7 @@ main(int argc, char **argv) args.data.mail.attachlist) && pine_state->next_screen)) free_attachment_list(&args.data.mail.attachlist); - goodnight_gracey(pine_state, 0); + goodnight_gracey(pine_state, 0); } else { q_status_message(SM_ORDER | SM_DING, 3, 4, diff --git a/alpine/folder.c b/alpine/folder.c index 94a27b7..c39b80a 100644 --- a/alpine/folder.c +++ b/alpine/folder.c @@ -3571,7 +3571,7 @@ char * folder_lister_fullname(FSTATE_S *fs, char *name) { if(fs->context->dir->status & CNTXT_SUBDIR){ - char tmp[2*MAILTMPLEN], tmp2[2*MAILTMPLEN], *p; + char tmp[2*MAILTMPLEN+1], tmp2[2*MAILTMPLEN+1], *p; if(fs->context->dir->ref){ snprintf(tmp, sizeof(tmp), "%.*s%.*s", diff --git a/alpine/imap.c b/alpine/imap.c index 91f87b1..e1abfd8 100644 --- a/alpine/imap.c +++ b/alpine/imap.c @@ -165,7 +165,7 @@ OAUTH2_S * oauth2_select_flow(char *host) { OAUTH2_S *oa2list, *oa2; - int i, rv; + int i = 0, rv; char *method; if(ps_global->ttyo){ @@ -474,7 +474,7 @@ char * oauth2_get_access_code(unsigned char *url, char *method, OAUTH2_S *oauth2, int *tryanother) { char tmp[MAILTMPLEN]; - char *code; + char *code = NULL; if(ps_global->ttyo){ SCROLL_S sargs; @@ -3775,6 +3775,7 @@ write_passfile(pinerc, l) fclose(fp); #ifdef SMIME if(text != NULL){ + i = 0; /* to quell gcc */ if(ps_global->pwdcert == NULL){ q_status_message(SM_ORDER, 3, 3, "Attempting to encrypt password file"); i = setup_pwdcert(&ps_global->pwdcert); diff --git a/alpine/mailcmd.c b/alpine/mailcmd.c index 905ddb1..6285e6e 100644 --- a/alpine/mailcmd.c +++ b/alpine/mailcmd.c @@ -662,6 +662,8 @@ view_text: thrd = fetch_thread(stream, mn_m2raw(msgmap, new_msgno)); if(thrd && thrd->top) topthrd = fetch_thread(stream, thrd->top); + else + topthrd = NULL; if(topthrd) j = count_lflags_in_thread(stream, topthrd, msgmap, MN_NONE); @@ -1340,7 +1342,7 @@ get_out: if(del_count > 0L){ state->mangled_footer = 1; /* MAX_SCREEN_COLS+1 = sizeof(prompt) */ snprintf(prompt, sizeof(prompt), "UNexclude %ld message%s in %.*s", del_count, - plural(del_count), MAX_SCREEN_COLS+1-40, + plural(del_count), MAX_SCREEN_COLS+1-45, pretty_fn(state->cur_folder)); prompt[sizeof(prompt)-1] = '\0'; if(F_ON(F_FULL_AUTO_EXPUNGE, state) @@ -1718,6 +1720,7 @@ cmd_flag(struct pine *state, MSGNO_S *msgmap, int aopt) char *keyword_array[2]; int user_defined_flags = 0, mailbox_flags = 0; int directly_to_maint_screen = 0; + int use_maint_screen = F_ON(F_FLAG_SCREEN_DFLT, ps_global); long unflagged, flagged, flags, rawno; MESSAGECACHE *mc = NULL; KEYWORD_S *kw; @@ -1949,11 +1952,8 @@ go_again: else #endif { - int use_maint_screen; int keyword_shortcut = 0; - use_maint_screen = F_ON(F_FLAG_SCREEN_DFLT, ps_global); - if(!use_maint_screen){ /* * We're going to call cmd_flag_prompt(). We need @@ -2761,7 +2761,7 @@ save_prompt(struct pine *state, CONTEXT_S **cntxt, char *nfldr, size_t len_nfldr SaveDel *dela, SavePreserveOrder *prea) { int rc, ku = -1, n, flags, last_rc = 0, saveable_count = 0, done = 0; - int delindex, preindex, r; + int delindex = 0, preindex = 0, r; char prompt[6*MAX_SCREEN_COLS+1], *p, expanded[MAILTMPLEN]; char *buf = tmp_20k_buf; char shortbuf[200]; @@ -3255,7 +3255,7 @@ create_for_save_prompt(CONTEXT_S *context, char *folder, int sequence_sensitive) int cmd_expunge(struct pine *state, MAILSTREAM *stream, MSGNO_S *msgmap, int agg) { - long del_count, prefilter_del_count; + long del_count, prefilter_del_count = 0; int we_cancel = 0, rv = 0; char prompt[MAX_SCREEN_COLS+1]; char *sequence; @@ -3587,12 +3587,12 @@ cmd_export(struct pine *state, MSGNO_S *msgmap, int qline, int aopt) { char filename[MAXPATH+1], full_filename[MAXPATH+1], *err; char nmsgs[80]; - int r, leading_nl, failure = 0, orig_errno, rflags = GER_NONE; + int r, leading_nl, failure = 0, orig_errno = 0, rflags = GER_NONE; int flags = GE_IS_EXPORT | GE_SEQ_SENSITIVE, rv = 0; ENVELOPE *env; MESSAGECACHE *mc; BODY *b; - long i, count = 0L, start_of_append, rawno; + long i, count = 0L, start_of_append = 0, rawno; gf_io_t pc; STORE_S *store; struct variable *vars = state ? ps_global->vars : NULL; @@ -8266,7 +8266,7 @@ select_by_gm_content(MAILSTREAM *stream, MSGNO_S *msgmap, long int msgno, SEARCH int select_by_text(MAILSTREAM *stream, MSGNO_S *msgmap, long int msgno, SEARCHSET **limitsrch) { - int r, ku, type, we_cancel = 0, flags, rv, ekeyi = 0; + int r = '\0', ku, type, we_cancel = 0, flags, rv, ekeyi = 0; int not = 0, me = 0; char sstring[80], tmp[128]; char *p, *sval = NULL; diff --git a/alpine/mailindx.c b/alpine/mailindx.c index 63f9277..1dbb1b4 100644 --- a/alpine/mailindx.c +++ b/alpine/mailindx.c @@ -319,7 +319,7 @@ index_lister(struct pine *state, CONTEXT_S *cntxt, char *folder, MAILSTREAM *str { UCS ch; int cmd, which_keys, force, - cur_row, cur_col, km_popped, paint_status; + cur_row, cur_col = 0, km_popped, paint_status = 0; static int old_day = -1; long i, j, k, old_max_msgno; long lflagged, old_lflagged = 0L; @@ -804,6 +804,8 @@ view_a_thread: thrd = fetch_thread(stream, i); if(thrd && thrd->top) topthrd = fetch_thread(stream, thrd->top); + else + topthrd = NULL; if(topthrd){ set_thread_lflags(stream, topthrd, msgmap, MN_CHID, 1); set_thread_lflags(stream, topthrd, msgmap, MN_CHID2, 0); @@ -833,7 +835,7 @@ view_a_thread: case MC_MOUSE: { MOUSEPRESS mp; - int new_cur; + int new_cur = 0; mouse_get_last (NULL, &mp); mp.row -= 2; @@ -2429,7 +2431,7 @@ int index_scroll_to_pos (long int pos) { static short bad_timing = 0; - long i, j, k; + long i, j, k = 0; if(bad_timing) return (FALSE); diff --git a/alpine/mailview.c b/alpine/mailview.c index 1265b05..11ca4af 100644 --- a/alpine/mailview.c +++ b/alpine/mailview.c @@ -232,7 +232,7 @@ mail_view_screen(struct pine *ps) int we_cancel = 0, flags, cmd = 0; int force_prefer = 0; MESSAGECACHE *mc; - ENVELOPE *env; + ENVELOPE *env = NULL; BODY *body; STORE_S *store; HANDLE_S *handles = NULL; @@ -5023,14 +5023,16 @@ visible_linelen(int line) switch((i < st->line_lengths[line]) ? st->text_lines[line][i] : 0){ case TAG_HANDLE: i++; + n = 0; /* quell gcc */ /* skip the length byte plus <length> more bytes */ if(i < st->line_lengths[line]){ n = st->text_lines[line][i]; i++; } - if(i < st->line_lengths[line] && n > 0) + if(i < st->line_lengths[line] && n > 0){ i += n; + } break; diff --git a/alpine/osdep/debuging.c b/alpine/osdep/debuging.c index 015d38d..2ff0d7d 100644 --- a/alpine/osdep/debuging.c +++ b/alpine/osdep/debuging.c @@ -186,7 +186,7 @@ init_debug(void) void save_debug_on_crash(FILE *dfile, int (*keystrokes) (int *, char *, size_t)) { - char nbuf[5], crashfile[MAXPATH+1], filename[MAXPATH+1]; + char nbuf[11], crashfile[MAXPATH+1], filename[MAXPATH+1]; int i; struct stat dbuf, tbuf; time_t now = time((time_t *)0); diff --git a/alpine/osdep/fltrname.c b/alpine/osdep/fltrname.c index cd17266..7af381e 100644 --- a/alpine/osdep/fltrname.c +++ b/alpine/osdep/fltrname.c @@ -92,7 +92,7 @@ filter_filename(char *file, int *fatal, int strict) ill_file[MIN(ptr-file,sizeof(ill_file)-1)] = '\0'; snprintf(error, sizeof(error), "Character \"%s\" after \"%.*s\" not allowed in file name", - ill_char, ERRORLEN-50, ill_file); + ill_char, ERRORLEN-57, ill_file); } else { snprintf(error, sizeof(error), "First character, \"%s\", not allowed in file name", diff --git a/alpine/remote.c b/alpine/remote.c index 7d83b3e..eaa2d58 100644 --- a/alpine/remote.c +++ b/alpine/remote.c @@ -39,7 +39,7 @@ int rd_answer_forge_warning(int, MSGNO_S *, SCROLL_S *); int rd_prompt_about_forged_remote_data(int reason, REMDATA_S *rd, char *extra) { - char tmp[2000]; + char *p, tmp[2000]; char *unknown = "<unknown>"; int rv = -1; char *foldertype, *foldername, *special; @@ -47,6 +47,8 @@ rd_prompt_about_forged_remote_data(int reason, REMDATA_S *rd, char *extra) foldertype = (rd && rd->t.i.special_hdr && !strucmp(rd->t.i.special_hdr, REMOTE_ABOOK_SUBTYPE)) ? "address book" : (rd && rd->t.i.special_hdr && !strucmp(rd->t.i.special_hdr, REMOTE_PINERC_SUBTYPE)) ? "configuration" : "data"; foldername = (rd && rd->rn) ? rd->rn : unknown; special = (rd && rd->t.i.special_hdr) ? rd->t.i.special_hdr : unknown; + tmp[0] = '\0'; + p = tmp; dprint((1, "rd_check_out_forged_remote_data:\n")); dprint((1, " reason=%d\n", reason)); @@ -177,8 +179,6 @@ rd_prompt_about_forged_remote_data(int reason, REMDATA_S *rd, char *extra) free_handles(&handles); } else{ - char *p = tmp; - snprintf(p, sizeof(tmp), _("\nThe data in the remote %s folder\n\n %s\n\nlooks suspicious. The reason for the suspicion is\n\n "), foldertype, foldername); tmp[sizeof(tmp)-1] = '\0'; diff --git a/alpine/reply.c b/alpine/reply.c index 35331f4..42f5131 100644 --- a/alpine/reply.c +++ b/alpine/reply.c @@ -101,7 +101,7 @@ reply(struct pine *pine_state, ACTION_S *role_arg) { ADDRESS *saved_from, *saved_to, *saved_cc, *saved_resent; ADDRESS *us_in_to_and_cc, *ap; - ENVELOPE *env, *outgoing; + ENVELOPE *env = NULL, *outgoing; BODY *body, *orig_body = NULL; REPLY_S reply; void *msgtext = NULL; @@ -1497,8 +1497,8 @@ forward(struct pine *ps, ACTION_S *role_arg) { char *sig; int ret, forward_raw_body = 0, rv = 0, i; - long msgno, j, totalmsgs, rflags; - ENVELOPE *env, *outgoing; + long msgno = 0L, j, totalmsgs, rflags; + ENVELOPE *env = NULL, *outgoing; BODY *orig_body, *body = NULL; REPLY_S reply; void *msgtext = NULL; diff --git a/alpine/roleconf.c b/alpine/roleconf.c index eed2dd4..0ee3ec8 100644 --- a/alpine/roleconf.c +++ b/alpine/roleconf.c @@ -1162,7 +1162,7 @@ role_config_add(struct pine *ps, CONF_S **cl, long int rflags) { int rv = 0, first_pat = 0; PAT_S *new_pat = NULL, *cur_pat; - PAT_LINE_S *new_patline, *cur_patline; + PAT_LINE_S *new_patline = NULL, *cur_patline; PAT_STATE pstate; char title[80]; @@ -1290,7 +1290,7 @@ role_config_replicate(struct pine *ps, CONF_S **cl, long int rflags) { int rv = 0, first_pat = 0; PAT_S *new_pat = NULL, *cur_pat, *defpat = NULL; - PAT_LINE_S *new_patline, *cur_patline; + PAT_LINE_S *new_patline = NULL, *cur_patline; PAT_STATE pstate; char title[80]; @@ -1881,7 +1881,7 @@ role_config_addfile(struct pine *ps, CONF_S **cl, long int rflags) char dir2[MAXPATH+1], pdir[MAXPATH+1]; char *lc, *newfile = NULL; PAT_LINE_S *file_patline; - int rv = 0, len; + int rv = 0, len = 0; int r = 1, flags; HelpType help = NO_HELP; PAT_TYPE curtype; @@ -5511,11 +5511,12 @@ role_config_edit_screen(struct pine *ps, PAT_S *def, char *title, long int rflag (*result)->patgrp->folder = editlist_to_pattern(folder_pat); if(abook_type_pat && *abook_type_pat){ - for(j = 0; (f = inabook_fldr_types(j)); j++) + for(j = 0; (f = inabook_fldr_types(j)); j++){ if(!strucmp(abook_type_pat, f->name)){ (*result)->patgrp->inabook = f->value; break; } + } if(bitnset(INABOOK_FROM, inabook_type_list)) (*result)->patgrp->inabook |= IAB_FROM; @@ -6183,7 +6184,7 @@ calculate_inick_stuff(struct pine *ps) if(v && !v->global_val.p){ char *str, *astr, *lc, pdir[MAXPATH+1]; ADDRESS *addr; - int len; + int len = 0; switch(i){ case INICK_FROM_CONF: @@ -7120,7 +7121,7 @@ int role_text_tool(struct pine *ps, int cmd, CONF_S **cl, unsigned int flags) { OPT_SCREEN_S *saved_screen; - int rv = -1, oeflags, len, sig, r, i, cancel = 0; + int rv = -1, oeflags, len = 0, sig, r, i, cancel = 0; char *file, *err, title[20], *newfile, *lc, *addr, *fldr = NULL, *tmpfldr; char dir2[MAXPATH+1], pdir[MAXPATH+1], *p; char full_filename[MAXPATH+1], filename[MAXPATH+1]; diff --git a/alpine/send.c b/alpine/send.c index 79b6f29..6209d64 100644 --- a/alpine/send.c +++ b/alpine/send.c @@ -1047,7 +1047,7 @@ pine_simple_send(ENVELOPE *outgoing, /* envelope for outgoing message */ char **tobufp, *p, tmp[MAILTMPLEN]; void *messagebuf; int done = 0, retval = 0, x; - int lastrc, rc = 0, ku, i, resize_len, result, fcc_result; + int lastrc, rc = 0, ku, i, resize_len, result, fcc_result = 0; int og2s_done = 0; HelpType help; static HISTORY_S *history = NULL; @@ -1821,12 +1821,12 @@ pine_send(ENVELOPE *outgoing, struct mail_bodystruct **body, char *start_here_name = NULL; char *suggested_nntp_server = NULL; char *title = NULL; - struct headerentry *he, *headents, *he_to, *he_fcc, *he_news = NULL, *he_lcc = NULL, + struct headerentry *he, *headents, *he_to = NULL, *he_fcc = NULL, *he_news = NULL, *he_lcc = NULL, *he_from = NULL; PINEFIELD *pfields, *pf, *pf_nobody = NULL, *pf_to = NULL, - *pf_smtp_server, *pf_nntp_server, - *pf_fcc = NULL, *pf_err, *pf_uid, *pf_mbox, *pf_curpos, - *pf_ourrep, *pf_ourhdrs, **sending_order; + *pf_smtp_server = NULL, *pf_nntp_server = NULL, + *pf_fcc = NULL, *pf_err = NULL, *pf_uid = NULL, *pf_mbox = NULL, *pf_curpos = NULL, + *pf_ourrep = NULL, *pf_ourhdrs = NULL, **sending_order; METAENV header; ADDRESS *lcc_addr = NULL; ADDRESS *nobody_addr = NULL; @@ -3202,6 +3202,7 @@ pine_send(ENVELOPE *outgoing, struct mail_bodystruct **body, * In the Postpone case, just create it if the user wants to * and create a temporary storage object to write into. */ fake_hup: + fcc_result = 0; lmc.all_written = lmc.text_only = lmc.text_written = 0; if(editor_result & (COMP_GOTHUP | COMP_CANCEL)){ int newfile = 1; @@ -5285,7 +5286,7 @@ filter_message_text(char *fcmd, ENVELOPE *outgoing, struct mail_bodystruct *body ? &body->nested.part->body.contents.text.data : &body->contents.text.data), *tmp_so = NULL, *tmpf_so, - *save_local_so, *readthis_so, *our_tmpf_so = NULL; + *save_local_so, *readthis_so = NULL, *our_tmpf_so = NULL; #define DO_HEADERS 1 if(fcmd |