+10
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
snprintf has a weird return value. It returns what would have been written given a large enough buffer. In the case that the prefix is longer then our buffer(128), it messes up the calculations below possibly causing heap corruption. To avoid this we double check and set the length at the maximum (size minus null byte