Skip to content

Commit e144778

Browse files
committed
CPP: Remove dubious case from FormatLiteral.getMaxConvertedLength.
1 parent 1b71acc commit e144778

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

cpp/ql/src/semmle/code/cpp/commons/Printf.qll

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -866,15 +866,7 @@ class FormatLiteral extends Literal {
866866
len = 1
867867
or (
868868
this.getConversionChar(n).toLowerCase()="c" and
869-
if (this.getEffectiveCharConversionChar(n)="C" and
870-
not isMicrosoft() and
871-
not isWideCharDefault()) then (
872-
len = 6 // MB_LEN_MAX
873-
// the wint_t (wide character) argument is converted
874-
// to a multibyte sequence by a call to the wcrtomb(3)
875-
) else (
876-
len = 1 // e.g. 'a'
877-
)
869+
len = 1 // e.g. 'a'
878870
) or this.getConversionChar(n).toLowerCase()="f" and
879871
exists(int dot, int afterdot |
880872
(if this.getPrecision(n) = 0 then dot = 0 else dot = 1)

0 commit comments

Comments
 (0)