Skip to content

filt/remez.c: ensure string format security.

Étienne Mollier requested to merge emollier/EDFbrowser:format-security into master

This patch addresses a compilation failure when building EDFbrowser with -Werror=format-security with gcc:

filt/remez.c: In function ‘init_frequencies’:
filt/remez.c:174:27: error: format not a string literal and no format arguments [-Werror=format-security]
  174 |       fprintf(stderr, spec->err_msg);
      |                       ~~~~^~~~~~~~~
filt/remez.c: In function ‘func_b’:
filt/remez.c:1024:25: error: format not a string literal and no format arguments [-Werror=format-security]
 1024 |     fprintf(stderr, spec->err_msg);
      |                     ~~~~^~~~~~~~~

The spec->err_msg should be preformatted already, so any occurrence of a percent format control in the resulting string may result in a crash of the function trying to print out the message to stderr. It should be unlikely, but in doubt…

Signed-off-by: Étienne Mollier emollier@debian.org

Merge request reports