summaryrefslogtreecommitdiff
path: root/apps/pdfapp.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-02-19 16:18:38 +0100
committerTor Andersson <tor.andersson@artifex.com>2013-02-19 18:46:40 +0100
commit68169ec2511425d018c03a997f95ebfe043e41f9 (patch)
tree3c429e02ff9b816d09177b11491e6fbe3c253f95 /apps/pdfapp.c
parent9cc9978a7260d201137459a65601e35dce1d444e (diff)
downloadmupdf-68169ec2511425d018c03a997f95ebfe043e41f9.tar.xz
Bug 693639: Use strlcpy instead of strncpy!
strncpy is *not* the correct function to use. It does not null terminate, and it needlessly zeroes past the end. It was designed for fixed length database records, not strings. Use fz_strlcpy and strlcat instead.
Diffstat (limited to 'apps/pdfapp.c')
-rw-r--r--apps/pdfapp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c
index 40b57e1a..bc0c3188 100644
--- a/apps/pdfapp.c
+++ b/apps/pdfapp.c
@@ -342,7 +342,7 @@ static int pdfapp_save(pdfapp_t *app)
if (written)
{
char buf2[PATH_MAX];
- strncpy(buf2, app->docpath, PATH_MAX);
+ fz_strlcpy(buf2, app->docpath, PATH_MAX);
pdfapp_close(app);
winreplacefile(buf, buf2);
pdfapp_open(app, buf2, 1);