Skip to content

Shubfach buffer overflow #15

Description

@Jerome-PS

Hi,

Thank you for your work.
In file src/schubfach_32.h, there is the following declaration:
constexpr int FtoaMinBufferLength = 32;
But when calling Ftoa with a negative number (for example -10), the function writes at least to buffer[32]. Because the negative causes buffer to advance
buffer += v.SignBit();
and then there are the two
std::memset(buffer + 0, '0', 16);
std::memset(buffer + 16, '0', 16);

This is for instance flagged by asan.

Keep up the good work!

Best regards,
JH.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions