diff options
| author | Karol Babioch <karol@babioch.de> | 2018-03-03 10:10:32 +0100 |
|---|---|---|
| committer | Karol Babioch <karol@babioch.de> | 2018-03-03 10:11:39 +0100 |
| commit | e351c22ee8c4d8cef0f212831a00447bc0400601 (patch) | |
| tree | c103bbeded81ead1b7ede9c7ae3840eea74786ee /src | |
| parent | 564fbfb67830e2eb234bc16b3db8fecf54261f95 (diff) | |
jp3d: Replace sprintf() by snprintf() in volumetobin()
This replaces the unsafe sprintf() invocation by the safer snprintf()
one, with the correct buffer size to prevent buffer overflows.
This fixes #1085.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/jp3d/convert.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/jp3d/convert.c b/src/bin/jp3d/convert.c index 7d802445..23fd70b0 100644 --- a/src/bin/jp3d/convert.c +++ b/src/bin/jp3d/convert.c @@ -788,7 +788,7 @@ int volumetobin(opj_volume_t * volume, char *outfile) fclose(fdest); - sprintf(name, "%s.img", outfile); + snprintf(name, sizeof(name), "%s.img", outfile); fimgdest = fopen(name, "w"); if (!fimgdest) { fprintf(stdout, "[ERROR] Failed to open %s for writing\n", name); |
