JoshClose / CsvHelper

Library to help reading and writing CSV files
http://joshclose.github.io/CsvHelper/
Other
4.63k stars 1.05k forks source link

Incorrect array length determination in ByteArrayConverter.HexStringToByteArray #2225

Open romaashka opened 5 months ago

romaashka commented 5 months ago

Current:

var length = has0x
        ? (hex.Length - 1) / ByteLength
    : hex.Length + 1 / ByteLength;

Must be:

var length = has0x
        ? (hex.Length - 1) / ByteLength
    :  (hex.Length + 1) / ByteLength; // need parentheses