mesa: prevent common string formatting security issues
authorMark Janes <mark.a.janes@intel.com>
Mon, 3 Jun 2019 23:59:45 +0000 (16:59 -0700)
committerMark Janes <mark.a.janes@intel.com>
Tue, 4 Jun 2019 19:49:38 +0000 (12:49 -0700)
commitc9c1e26106478258d8a91fe8fc5c69d8c3fa5206
tree711c21b515e60bfabd7ed0a03caa9ce9010a3fee
parentf4ef34f207d15bcade7aed644328035dd0f2cc16
mesa: prevent common string formatting security issues

Adds a compile-time error for obvious security issues like:

  printf(string_var);

The proposed flag is more tolerant than -Wformat-nonliteral.
Specifically, it tolerates common mesa formatting like:

  static const char *shader_template = "really long string %d";
  printf(shader_template, uniform_number);

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110833
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
meson.build