diff options
author | Julian Smith <jules@op59.net> | 2019-11-22 18:08:05 +0000 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2019-11-22 18:54:20 +0000 |
commit | 354715346deed252ef7db53160b61d04bd630a2f (patch) | |
tree | 73bb050806dfda66ea62727181f1ad4056302a3c | |
parent | b8c8a6410658fdfe57ad5de4ae57fdc4cbece2ab (diff) | |
download | ghostpdl-354715346deed252ef7db53160b61d04bd630a2f.tar.gz |
Coverity 351049: avoid buffer overflow warning.
We're actually safe because gp_fmode_binary_suffix is max one-character long,
but Coverity doesn't know that.
-rw-r--r-- | base/gxclfile.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/base/gxclfile.c b/base/gxclfile.c index d2887dd2f..841009a01 100644 --- a/base/gxclfile.c +++ b/base/gxclfile.c @@ -476,8 +476,7 @@ clist_rewind(clist_file_ptr cf, bool discard_data, const char *fname) IFILE *ocf = fake_path_to_file(fname); char fmode[4]; - strcpy(fmode, "w+"); - strcat(fmode, gp_fmode_binary_suffix); + snprintf(fmode, sizeof(fmode), "w+%s", gp_fmode_binary_suffix); if (ocf) { if (discard_data) { |