Merge pull request #1101 from kbabioch/fix/jp3d-sprintf-overflow

jp3d: Replace sprintf() by snprintf() in volumetobin()
This commit is contained in:
Even Rouault 2018-03-04 23:10:48 +01:00 committed by GitHub
commit b02e0d9c4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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);