Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An integer overflow in function sixel_decode_raw_impl at fromsixel.c:650 #105

Closed
YourButterfly opened this issue Dec 2, 2019 · 2 comments

Comments

@YourButterfly
Copy link

libsixel

version

libsixel 1.8.2

description

None

download link

None

others

please send email to  teamseri0us360@gmail.com if you have any questions.

sixel_decode_raw_impl@fromsixel.c:650_integer_overflow

description

An issue was discovered in libsixel 1.8.2, There is an integer overflow in function sixel_decode_raw_impl at fromsixel.c:650

commandline

img2sixel @@ -o /dev/null

source

In a while loop, it do not check if integer overflow is in context->param = context->param * 10 + *p - '0';

            switch (*p) {
            case '\x1b':
                context->state = PS_ESC;
                p++;
                break;
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                context->param = context->param * 10 + *p - '0';
                p++;
                break;
            case ';':
                if (context->nparams < DECSIXEL_PARAMS_MAX) {
                    context->params[context->nparams++] = context->param;
                }
                context->param = 0;
                p++;
                break;
            default:
@carnil
Copy link

carnil commented Dec 8, 2019

CVE-2019-19637 was assigned for this issue.

@saitoha
Copy link
Owner

saitoha commented Dec 17, 2019

Merged your PR on v1.8.3. Thanks!

@saitoha saitoha closed this as completed Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants