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

bug2: an interger overflow of swfmill swf2xml #47

Open
ghost opened this issue Jul 1, 2018 · 0 comments
Open

bug2: an interger overflow of swfmill swf2xml #47

ghost opened this issue Jul 1, 2018 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 1, 2018

poc:
https://drive.google.com/open?id=1o3DyrB2cT_yHOMqYWOUXxHKqgHKQ3Oad
asan:
https://drive.google.com/open?id=1FfVhfhB_lJc6bAYOWyoOkjz-Udmn0l9J

r->position() + len caused a interger overflow at line 6857 of file gSWFParser.cpp

if( r->getPosition() != file_offset + len ) {
     fprintf( stderr, "WARNING: end of tag %s is @%i, should be @%i\n",
             "DefineSprite",
             r->getPosition(),
             file_offset+len );
     r->seekTo( file_offset + len );
 }

it will make cur pos to a negative number
then in the function getword, the pos will be a really big number, then it will cause an oob access.

uint16_t Reader::getWord() {
     if (pos+2 > length) {
         err = Reader::eof;
         pos = length+1;
         return 0;
     }
     printf("%d\n", pos);
     int r = data[pos++];
     r += data[pos++]<<8;
     return r;
 }

@djcsdy djcsdy added the bug label Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant