This commit is contained in:
Zhi Guan
2026-06-17 16:55:36 +08:00
parent b0e5c4aa1b
commit cad645da20
6 changed files with 19 additions and 8 deletions

View File

@@ -103,6 +103,9 @@ int cmsencrypt_main(int argc, char **argv)
}
cert = rcpt_certs;
// FIXME: TOCTOU between file_size measurement and fread. If the file shrinks
// after measurement, the buffer is oversized but only actual bytes read are
// encrypted (inlen is updated by fread). If the file grows, data is truncated.
if (get_files_size(argc, argv, "-in", &inlen) != 1) {
goto end;
}