check_kernel_printf.c: Handle 'fmt ? : "default"'
commitb267c9cd1516dd349e3891f22198dd076723d22e
authorRasmus Villemoes <rv@rasmusvillemoes.dk>
Wed, 11 Feb 2015 12:46:22 +0000 (11 13:46 +0100)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 12 Feb 2015 20:43:12 +0000 (12 23:43 +0300)
treeac437453febfcc0af93a080271478e48d75b245d
parent4a08be60b341329d17800e9c32761cfde54f103e
check_kernel_printf.c: Handle 'fmt ? : "default"'

It is not completely unlikely that someone could make a call like
sprintf(buf, fmt ? : "some default");. In that case, ->cond_true is
NULL, and we should therefore use ->conditional instead. That is very
unlikely to be a string literal which we can actually check (why would
the ?: then be used), but it might come from some macro expansion, and
it's certainly better than segfaulting.
check_kernel_printf.c