File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
cpp/ql/src/semmle/code/cpp/models/interfaces Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,15 @@ private Type getAFormatterWideTypeOrDefault() {
1919 )
2020}
2121
22+ private Type stripTopLevelSpecifiersOnly ( Type t ) {
23+ (
24+ result = stripTopLevelSpecifiersOnly ( t .( SpecifiedType ) .getBaseType ( ) )
25+ ) or (
26+ result = t and
27+ not t instanceof SpecifiedType
28+ )
29+ }
30+
2231/**
2332 * A standard library function that uses a `printf`-like formatting string.
2433 */
@@ -37,8 +46,8 @@ abstract class FormattingFunction extends Function {
3746 * `char` or `wchar_t`.
3847 */
3948 Type getDefaultCharType ( ) {
40- result = getParameter ( getFormatParameterIndex ( ) ) .getType ( ) .
41- getUnderlyingType ( ) .( PointerType ) .getBaseType ( ) . stripTopLevelSpecifiers ( )
49+ result = stripTopLevelSpecifiersOnly ( getParameter ( getFormatParameterIndex ( ) ) .getType ( ) .
50+ getUnderlyingType ( ) .( PointerType ) .getBaseType ( ) )
4251 }
4352
4453 /**
You can’t perform that action at this time.
0 commit comments