summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2021-07-31 21:16:15 -0600
committerEduardo Chappa <chappa@washington.edu>2021-07-31 21:16:15 -0600
commit8167f58e118afa658590253f8696c816511c3708 (patch)
treeb79d65ce860848c50449b69ae299898b71c3e322 /pith
parentbba1f63e9be0b65c090d1707a6c9168443604ed6 (diff)
downloadalpine-8167f58e118afa658590253f8696c816511c3708.tar.xz
* Clear more warnings given by gcc-10. Work in progress.
Diffstat (limited to 'pith')
-rw-r--r--pith/conf.c2
-rw-r--r--pith/filter.c2
-rw-r--r--pith/pine.hlp2
-rw-r--r--pith/reply.c9
-rw-r--r--pith/smime.c27
-rw-r--r--pith/smkeys.c7
6 files changed, 28 insertions, 21 deletions
diff --git a/pith/conf.c b/pith/conf.c
index 809dfe6d..452c6db2 100644
--- a/pith/conf.c
+++ b/pith/conf.c
@@ -4885,7 +4885,7 @@ set_feature_list_current_val(struct variable *var)
*/
j = 0;
- strncpy(no_allow, "no-", 3);
+ strcpy(no_allow, "no-");
strncpy(no_allow+3, feature_list_name(F_ALLOW_CHANGING_FROM), sizeof(no_allow)-3-1);
no_allow[sizeof(no_allow)-1] = '\0';
diff --git a/pith/filter.c b/pith/filter.c
index 4607cc63..e4f72058 100644
--- a/pith/filter.c
+++ b/pith/filter.c
@@ -5794,7 +5794,7 @@ html_li(HANDLER_S *hd, int ch, int cmd)
if(PASS_HTML(hd->html_data)){
}
else{
- char buf[16], tmp[16], *p;
+ char buf[20], tmp[16], *p;
int wrapstate;
/* Start a new line */
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 08eb3077..9c8a5f90 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 568 2021-07-30 09:00:01
+Alpine Commit 569 2021-07-31 21:16:12
============= h_news =================
<HTML>
<HEAD>
diff --git a/pith/reply.c b/pith/reply.c
index 636afa45..92172c05 100644
--- a/pith/reply.c
+++ b/pith/reply.c
@@ -2331,10 +2331,11 @@ forward_subject(ENVELOPE *env, int flags)
removing_trailing_white_space(tmp_20k_buf);
if((l = strlen(tmp_20k_buf)) < 1000 &&
(l < 5 || strcmp(tmp_20k_buf+l-5,"(fwd)"))){
- snprintf(tmp_20k_buf+2000, SIZEOF_20KBUF-2000, "%s (fwd)", tmp_20k_buf);
- tmp_20k_buf[SIZEOF_20KBUF-2000-1] = '\0';
- memmove(tmp_20k_buf, tmp_20k_buf+2000, strlen(tmp_20k_buf+2000));
- tmp_20k_buf[strlen(tmp_20k_buf+2000)] = '\0';
+ char *s = cpystr(tmp_20k_buf);
+ snprintf(tmp_20k_buf, SIZEOF_20KBUF, "%.1000s (fwd)", s);
+ tmp_20k_buf[SIZEOF_20KBUF-1] = '\0';
+ strcpy(tmp_20k_buf, s);
+ fs_give((void **) &s);
}
/*
diff --git a/pith/smime.c b/pith/smime.c
index 0ef77e50..e6f207f9 100644
--- a/pith/smime.c
+++ b/pith/smime.c
@@ -782,15 +782,16 @@ import_certificate(WhichCerts ctype, PERSONAL_CERT *p_cert, char *fname)
text = decrypt_file((char *)tmp, NULL, pwdcert);
if(text != NULL){
if(pc == NULL){
- pc = fs_get(sizeof(PERSONAL_CERT));
- memset((void *)pc, 0, sizeof(PERSONAL_CERT));
filename[strlen(filename)-strlen(EXTCERT(Private))] = '\0';
- pc->name = cpystr(filename);
- snprintf(buf, sizeof(buf), "%s%s", filename, EXTCERT(Public));
- buf[sizeof(buf)-1] = '\0';
- pc->cname = cpystr(buf);
- pc->key = key;
- pc->cert = cert;
+ if(strlen(filename) + strlen(EXTCERT(Public)) < MAXPATH){
+ pc = fs_get(sizeof(PERSONAL_CERT));
+ memset((void *)pc, 0, sizeof(PERSONAL_CERT));
+ pc->name = cpystr(filename);
+ pc->cname = fs_get(strlen(filename) + strlen(EXTCERT(Public)) + 1);
+ sprintf(pc->cname, "%s%s", filename, EXTCERT(Public));
+ pc->key = key;
+ pc->cert = cert;
+ }
}
if(encrypt_file((char *)tmp, text, pc)){ /* we did it! */
@@ -855,7 +856,7 @@ import_certificate(WhichCerts ctype, PERSONAL_CERT *p_cert, char *fname)
if(!ps_global->smime->privatecertlist){
ps_global->smime->privatecertlist = fs_get(sizeof(CertList));
- memset((void *)DATACERT(ctype), 0, sizeof(CertList));
+ memset((void *) ps_global->smime->privatecertlist, 0, sizeof(CertList));
}
for(s = t = filename; (t = strstr(s, ".key")) != NULL; s = t + 1);
@@ -1930,9 +1931,11 @@ copy_dir_to_container(WhichCerts which, char *contents)
fpath[sizeof(fpath) - 1] = '\0';
}
else if(ret_dir){
- if(strlen(dstpath) + strlen(configcontainer) - strlen(ret_dir) + 1 < sizeof(dstpath))
- snprintf(fpath, sizeof(fpath), "%s%c%s",
- dstpath, tempfile[strlen(ret_dir)], configcontainer);
+ if(strlen(dstpath) + strlen(configcontainer) + 2 < sizeof(dstpath))
+ snprintf(fpath, sizeof(fpath), "%.*s%c%.*s",
+ (int) strlen(dstpath), dstpath,
+ tempfile[strlen(ret_dir)],
+ (int) (sizeof(fpath) - strlen(dstpath) - 1), configcontainer);
else
ret = -1;
}
diff --git a/pith/smkeys.c b/pith/smkeys.c
index 495f0a53..e4402c24 100644
--- a/pith/smkeys.c
+++ b/pith/smkeys.c
@@ -1053,8 +1053,11 @@ save_cert_for(char *email, X509 *cert, WhichCerts ctype)
}
else{
if(strlen(path) + strlen(tempfile) - strlen(ret_dir) + 1 < sizeof(path))
- snprintf(fpath, sizeof(fpath), "%s%c%s",
- path, tempfile[strlen(ret_dir)], tempfile + strlen(ret_dir) + 1);
+ snprintf(fpath, sizeof(fpath), "%.*s%c%.*s",
+ (int) strlen(path), path,
+ tempfile[strlen(ret_dir)],
+ (int) (sizeof(fpath) - strlen(fpath) - 1),
+ tempfile + strlen(ret_dir) + 1);
else
err++;
}