diff options
Diffstat (limited to 'pith')
-rw-r--r-- | pith/Makefile.am | 12 | ||||
-rw-r--r-- | pith/Makefile.in | 29 | ||||
-rw-r--r-- | pith/charconv/Makefile.in | 9 | ||||
-rw-r--r-- | pith/ical.c | 11 | ||||
-rw-r--r-- | pith/osdep/Makefile.in | 9 | ||||
-rw-r--r-- | pith/pine.hlp | 2 | ||||
-rw-r--r-- | pith/send.c | 2 | ||||
-rw-r--r-- | pith/smime.c | 21 |
8 files changed, 34 insertions, 61 deletions
diff --git a/pith/Makefile.am b/pith/Makefile.am index a1f66093..62052ed5 100644 --- a/pith/Makefile.am +++ b/pith/Makefile.am @@ -30,12 +30,12 @@ libpith_a_SOURCES = ablookup.c abdlc.c addrbook.c addrstring.c adrbklib.c bldadd state.c status.c store.c stream.c string.c strlst.c takeaddr.c tempfile.c text.c \ thread.c adjtime.c url.c util.c helptext.c smkeys.c smime.c -help_c_gen$(BUILD_EXEEXT): help_c_gen.c - @rm -f help_c_gen$(BUILD_EXEEXT) - $(CC_FOR_BUILD) help_c_gen.c -o help_c_gen$(BUILD_EXEEXT) -help_h_gen$(BUILD_EXEEXT): - @rm -f help_h_gen$(BUILD_EXEEXT) - $(CC_FOR_BUILD) help_h_gen.c -o help_h_gen$(BUILD_EXEEXT) +help_c_gen$(EXEEXT): $(help_c_gen_OBJECTS) $(help_c_gen_DEPENDENCIES) + @rm -f help_c_gen$(EXEEXT) + $(LINK) $(help_c_gen_OBJECTS) $(help_c_gen_LDADD) +help_h_gen$(EXEEXT): $(help_h_gen_OBJECTS) $(help_h_gen_DEPENDENCIES) + @rm -f help_h_gen$(EXEEXT) + $(LINK) $(help_h_gen_OBJECTS) $(help_h_gen_LDADD) helptext.c: help_c_gen pine.hlp ./help_c_gen < pine.hlp > $@ diff --git a/pith/Makefile.in b/pith/Makefile.in index 43c0e970..8eae1cca 100644 --- a/pith/Makefile.in +++ b/pith/Makefile.in @@ -110,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/m4_ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -280,18 +279,12 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_OBJEXT = @BUILD_OBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ -CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ -CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ -CPP_FOR_BUILD = @CPP_FOR_BUILD@ CYGPATH_W = @CYGPATH_W@ C_CLIENT_AUTHS = @C_CLIENT_AUTHS@ C_CLIENT_BUNDLED = @C_CLIENT_BUNDLED@ @@ -325,7 +318,6 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ ISPELLPROG = @ISPELLPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ @@ -392,7 +384,6 @@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ alpine_interactive_spellcheck = @alpine_interactive_spellcheck@ @@ -508,14 +499,6 @@ clean-noinstPROGRAMS: echo " rm -f" $$list; \ rm -f $$list -help_c_gen$(EXEEXT): $(help_c_gen_OBJECTS) $(help_c_gen_DEPENDENCIES) $(EXTRA_help_c_gen_DEPENDENCIES) - @rm -f help_c_gen$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(help_c_gen_OBJECTS) $(help_c_gen_LDADD) $(LIBS) - -help_h_gen$(EXEEXT): $(help_h_gen_OBJECTS) $(help_h_gen_DEPENDENCIES) $(EXTRA_help_h_gen_DEPENDENCIES) - @rm -f help_h_gen$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(help_h_gen_OBJECTS) $(help_h_gen_LDADD) $(LIBS) - mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -905,12 +888,12 @@ uninstall-am: .PRECIOUS: Makefile -help_c_gen$(BUILD_EXEEXT): help_c_gen.c - @rm -f help_c_gen$(BUILD_EXEEXT) - $(CC_FOR_BUILD) help_c_gen.c -o help_c_gen$(BUILD_EXEEXT) -help_h_gen$(BUILD_EXEEXT): - @rm -f help_h_gen$(BUILD_EXEEXT) - $(CC_FOR_BUILD) help_h_gen.c -o help_h_gen$(BUILD_EXEEXT) +help_c_gen$(EXEEXT): $(help_c_gen_OBJECTS) $(help_c_gen_DEPENDENCIES) + @rm -f help_c_gen$(EXEEXT) + $(LINK) $(help_c_gen_OBJECTS) $(help_c_gen_LDADD) +help_h_gen$(EXEEXT): $(help_h_gen_OBJECTS) $(help_h_gen_DEPENDENCIES) + @rm -f help_h_gen$(EXEEXT) + $(LINK) $(help_h_gen_OBJECTS) $(help_h_gen_LDADD) helptext.c: help_c_gen pine.hlp ./help_c_gen < pine.hlp > $@ diff --git a/pith/charconv/Makefile.in b/pith/charconv/Makefile.in index 49af247e..b9ea7b23 100644 --- a/pith/charconv/Makefile.in +++ b/pith/charconv/Makefile.in @@ -108,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/m4_ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -207,18 +206,12 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_OBJEXT = @BUILD_OBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ -CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ -CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ -CPP_FOR_BUILD = @CPP_FOR_BUILD@ CYGPATH_W = @CYGPATH_W@ C_CLIENT_AUTHS = @C_CLIENT_AUTHS@ C_CLIENT_BUNDLED = @C_CLIENT_BUNDLED@ @@ -252,7 +245,6 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ ISPELLPROG = @ISPELLPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ @@ -319,7 +311,6 @@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ alpine_interactive_spellcheck = @alpine_interactive_spellcheck@ diff --git a/pith/ical.c b/pith/ical.c index 332ed5d4..5079ceb9 100644 --- a/pith/ical.c +++ b/pith/ical.c @@ -238,10 +238,13 @@ ical_decode(char *text, unsigned short encoding) { unsigned char *t; unsigned long callen; + size_t tlen; if(encoding == ENCQUOTEDPRINTABLE){ t = rfc822_qprint ((unsigned char *) text,strlen(text),&callen); if(t != NULL){ - strncpy(text, t, strlen(t)); + tlen = strlen(text) + 1; + strncpy(text, t, tlen); + text[tlen - 1] = '\0'; fs_give((void **) &t); } } @@ -260,10 +263,12 @@ ical_remove_escapes(char **textp) char *text, *s, *t; int rv = 0; int escaped; + size_t tlen; if(textp == NULL) return 0; t = cpystr(*textp); /* work on a copy of the text */ + tlen = strlen(*textp) + 1; /* and record its size */ /* the variable text below points to the beginning of the filtered text */ for (text = s = t, escaped = 0; rv == 0 && *s != '\0'; s++){ if(*s == '\\' && escaped == 0){ @@ -292,8 +297,8 @@ ical_remove_escapes(char **textp) *t = '\0'; /* tie off filtered text */ t = text; /* reset t to the beginning */ if(rv == 0){ - strncpy(*textp, t, strlen(t)); /* overwrite given text with filtered text */ - (*textp)[strlen(t)] = '\0'; + strncpy(*textp, t, tlen); /* overwrite given text with filtered text */ + (*textp)[tlen - 1] = '\0'; } fs_give((void **) &t); return rv; diff --git a/pith/osdep/Makefile.in b/pith/osdep/Makefile.in index 4e37b22f..679b91f0 100644 --- a/pith/osdep/Makefile.in +++ b/pith/osdep/Makefile.in @@ -108,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/m4_ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -214,18 +213,12 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_OBJEXT = @BUILD_OBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ -CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ -CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ -CPP_FOR_BUILD = @CPP_FOR_BUILD@ CYGPATH_W = @CYGPATH_W@ C_CLIENT_AUTHS = @C_CLIENT_AUTHS@ C_CLIENT_BUNDLED = @C_CLIENT_BUNDLED@ @@ -259,7 +252,6 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ ISPELLPROG = @ISPELLPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ @@ -326,7 +318,6 @@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ alpine_interactive_spellcheck = @alpine_interactive_spellcheck@ diff --git a/pith/pine.hlp b/pith/pine.hlp index d88b80f4..d7af4f7f 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 434 2020-06-07 21:20:48 +Alpine Commit 435 2020-06-08 02:41:56 ============= h_news ================= <HTML> <HEAD> diff --git a/pith/send.c b/pith/send.c index a0585edf..39295a9e 100644 --- a/pith/send.c +++ b/pith/send.c @@ -4297,7 +4297,7 @@ pine_rfc822_output_body(struct mail_bodystruct *body, soutr_t f, void *s) #ifdef SMIME if(ps_global->smime && ps_global->smime->do_sign && strlen(tmp) < sizeof(tmp)-2) - strncat(tmp, "\015\012", 2); + strncat(tmp, "\015\012", sizeof(tmp) - strlen(tmp)); #endif if(lmc.so && !lmc.all_written){ so_puts(lmc.so, t); diff --git a/pith/smime.c b/pith/smime.c index e6e80515..499264de 100644 --- a/pith/smime.c +++ b/pith/smime.c @@ -478,7 +478,7 @@ smime_expunge_cert(WhichCerts ctype) if(SMHOLDERTYPE(ctype) == Directory){ build_path(buf, path, cl->next->name, sizeof(buf)); if(ctype == Private && strlen(buf) + strlen(EXTCERT(Private)) < sizeof(buf)){ - strncat(buf, EXTCERT(Private), 4); + strncat(buf, EXTCERT(Private), sizeof(buf) - strlen(buf)); buf[sizeof(buf)-1] = '\0'; } @@ -795,7 +795,7 @@ import_certificate(WhichCerts ctype, PERSONAL_CERT *p_cert, char *fname) if(encrypt_file((char *)tmp, text, pc)){ /* we did it! */ build_path(buf, PATHCERTDIR(ctype), pwdcert->name, sizeof(buf)); - strncat(buf, EXTCERT(Private), 4); + strncat(buf, EXTCERT(Private), sizeof(buf) - strlen(buf)); buf[sizeof(buf)-1] = '\0'; if(strcmp(PrivateKeyPath, buf)){ if (unlink(buf) < 0) @@ -867,7 +867,7 @@ import_certificate(WhichCerts ctype, PERSONAL_CERT *p_cert, char *fname) if(SMHOLDERTYPE(ctype) == Directory){ build_path(buf, PATHCERTDIR(ctype), filename, sizeof(buf)); if(strcmp(buf + strlen(buf) - 4, EXTCERT(ctype)) != 0 && strlen(buf) + 4 < sizeof(buf)){ - strncat(buf, EXTCERT(ctype), 4); + strncat(buf, EXTCERT(ctype), sizeof(buf) - strlen(buf)); buf[sizeof(buf)-1] = '\0'; } rc = our_copy(buf, full_filename); @@ -892,7 +892,7 @@ import_certificate(WhichCerts ctype, PERSONAL_CERT *p_cert, char *fname) if(SMHOLDERTYPE(ctype) == Directory){ build_path(buf, PATHCERTDIR(ctype), filename, sizeof(buf)); if(strcmp(buf + strlen(buf) - 4, ".crt") != 0 && strlen(buf) + 4 < sizeof(buf)){ - strncat(buf, EXTCERT(ctype), 4); + strncat(buf, EXTCERT(ctype), sizeof(buf) - strlen(buf)); buf[sizeof(buf)-1] = '\0'; } @@ -1345,7 +1345,7 @@ get_personal_certs(char *path) pc = (PERSONAL_CERT *) fs_get(sizeof(*pc)); pc->cert = cert; pc->name = cpystr(buf2); - strncat(buf2, EXTCERT(Public), 4); + strncat(buf2, EXTCERT(Public), sizeof(buf2) - strlen(buf2)); pc->cname = cpystr(buf2); /* Try to load the key with an empty password */ @@ -1631,6 +1631,7 @@ add_file_to_container(WhichCerts ctype, char *fpath, char *altname) struct stat sbuf; STORE_S *in = NULL; int rv = -1; /* assume error */ + size_t clen; /* content buffer size */ if(our_stat(fpath, &sbuf) < 0 || (in = so_get(FileStar, fpath, READ_ACCESS | READ_FROM_LOCALE)) == NULL) @@ -1647,16 +1648,18 @@ add_file_to_container(WhichCerts ctype, char *fpath, char *altname) goto endadd; if(content){ - fs_resize((void **)&content, strlen(content) + strlen(sep) + strlen(name) + sbuf.st_size + 2*strlen(NEWLINE) + 1); /* 1 = \0*/ + clen = strlen(content) + strlen(sep) + strlen(name) + sbuf.st_size + 2*strlen(NEWLINE) + 1; + fs_resize((void **)&content, clen); s = content; content += strlen(content); } else{ - s = content = fs_get(strlen(sep) + strlen(name) + sbuf.st_size + strlen(NEWLINE) + 1); /* 1 = \0 */ + clen = strlen(sep) + strlen(name) + sbuf.st_size + strlen(NEWLINE) + 1; + s = content = fs_get(clen); *content = '\0'; } - strncat(content, sep, strlen(sep)); - strncat(content, name, strlen(name)); + strncat(content, sep, clen - strlen(content)); + strncat(content, name, clen - strlen(content)); content += strlen(content); #ifdef _WINDOWS *content++ = '\r'; |