summaryrefslogtreecommitdiff
path: root/pith/smkeys.c
diff options
context:
space:
mode:
Diffstat (limited to 'pith/smkeys.c')
-rw-r--r--pith/smkeys.c7
1 files changed, 5 insertions, 2 deletions
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++;
}