Menu

#42 DetectionStrategy conditional always true

Release 1.2.16
New
nobody
None
Medium
wazformat
Defect
2017-08-15
2017-08-15
No

In the class DetectionStrategy, the conditional

if (recursionLevel == 0 || !FormatEnum.UNKNOWN.equals(curFormat)) { … }

always evalutes to true due the lack of ".format" for curFormat, so the expression becomes "anything OR NOT false", "anything OR true", "true".

Since it has been like that since it has been introduced (revision 303) I'd suggest not to correct it, but to remove it.

For example, if you try to recognize a base64-ed unrecognizable file it would be better to have

[[BASE64], [UNKNOWN]]

while if you correct it you'd only have

[[BASE64]]

Discussion


Log in to post a comment.

MongoDB Logo MongoDB