Ventoy icon indicating copy to clipboard operation
Ventoy copied to clipboard

Add check on length of name.

Open celine-lee opened this issue 3 years ago • 1 comments

My team and I were looking through the Ventoy source code using our AI-based source code anomaly detection tool, MP-CodeCheck, and found this line that we think may benefit from a slight adjustment for the sake of maintainability: a check on the length of the string variable name before checking its first three characters.

We believe that this string length check helps as a safeguard against undefined behavior with the string character checking.

celine-lee avatar Apr 06 '22 06:04 celine-lee

IMHO, the check is unnecessary because of short-circuiting in if statement.

ventoy avatar Apr 06 '22 07:04 ventoy