Thread (1 message) 1 message, 1 author, 2018-07-17

Re: [PATCH v2 6/6] submodule--helper: introduce new update-module-mode helper

From: Junio C Hamano <hidden>
Date: 2018-07-17 21:44:15

SZEDER Gábor [off-list ref] writes:
quoted
+	fprintf(stdout, submodule_strategy_to_string(&update_strategy));
Various compilers warn about the potential insecurity of the above
call:

      CC builtin/submodule--helper.o
  builtin/submodule--helper.c: In function ‘module_update_module_mode’:
  builtin/submodule--helper.c:1502:2: error: format not a string literal and no format arguments [-Werror=format-security]
    fprintf(stdout, submodule_strategy_to_string(&update_strategy));
    ^
  cc1: all warnings being treated as errors
  Makefile:2261: recipe for target 'builtin/submodule--helper.o' failed
  make: *** [builtin/submodule--helper.o] Error 1

I think it should either use an explicit format string:

  fprintf(stdout, "%s", submodule_strategy_to_string(&update_strategy));

or, perhaps better yet, simply use fputs().
Sounds good.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help