curve : correct possible buffer overflow