
On 05/07/2013 05:46 AM, Ján Tomko wrote:
--- cfg.mk | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/cfg.mk b/cfg.mk index 1d63bbd..06f89d1 100644 --- a/cfg.mk +++ b/cfg.mk @@ -490,6 +490,11 @@ sc_prohibit_virBufferAdd_with_string_literal: halt='use virBufferAddLit, not virBufferAdd, with a string literal' \ $(_sc_search_regexp)
+sc_prohibit_virBufferAsprintf_with_string_literal: + @prohibit='\<virBufferAsprintf *\([^,]+, *"([^%"]|\")*"\)' \ ^^^^^^^^^^^^^ I think it's slightly tighter to write "([^%"\]|\\.|%%)*" to pick up all backslash sequences as well as literal % in a printf format, and so that a string that ends in a backslash ("foo\\") doesn't fail to find the closing ". But those are corner cases; as written you catch 99.99% of offending code.
+ halt='use virBufferAddLit, not virBufferAsprintf, with a string literal' \ + $(_sc_search_regexp)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org