In commit 0b368eae3bcc7e88352355824b2329d4f234e3d5 we are left with the following code:
/* Get the name for the Q NDF for this block. Start of with "Q" followed by
the block index. */
iblock++;
nc = sprintf( ndfname, "Q%d", iblock );
/* Append the subarray name to the NDF name. */
nc += sprintf( ndfname + nc, "_%s", subarray );
/* Append the chunk index to the NDF name. */
nc += sprintf( ndfname + nc, "_%d", (int) ichunk );
in smurf_calcqu.c. The second two lines were historically protected by if-statements and so were distinct. Now this could all be done in a single sprintf. Furthermore, one_snprintf should be used to protect against buffer overflow.
There are many unprotected sprintf uses in SMURF. Particular care should be taken when using %s.
In commit 0b368eae3bcc7e88352355824b2329d4f234e3d5 we are left with the following code:
in
smurf_calcqu.c
. The second two lines were historically protected byif
-statements and so were distinct. Now this could all be done in a singlesprintf
. Furthermore,one_snprintf
should be used to protect against buffer overflow.There are many unprotected
sprintf
uses in SMURF. Particular care should be taken when using%s
.