Skip to content

Commit

Permalink
'gfc_xvt.c' (code to convert spherical harmonics coefficients to a C …
Browse files Browse the repository at this point in the history
…array) : used a %40s specifier for a 40-byte buffer, ignoring the possible zero terminator requiring a 41-byte buffer. Found by gcc, reported by Francisco Ocaña.
  • Loading branch information
Bill-Gray committed Sep 26, 2023
1 parent 4f528fd commit 5bb0236
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gfc_xvt.c
Expand Up @@ -78,7 +78,7 @@ int main( const int argc, const char **argv)
if( !memcmp( buff, "gfc ", 4) && atoi( buff + 3) <= max_l)
{
int l, m, n_scanned;
char c_term[40], s_term[40];
char c_term[41], s_term[41];
char *tptr;

n_scanned = sscanf( buff + 4, "%d %d %40s %40s", &l, &m, c_term, s_term);
Expand Down

0 comments on commit 5bb0236

Please sign in to comment.