Menu

#15 buffer overflow with ubuntu 8.4

open
nobody
None
5
2009-01-05
2009-01-05
Anonymous
No

Just upgraded to ubuntu 8.4 and wx200d is throwing buffer overflows. Just wondering if anyone has any hints on how to fix this.

Discussion

  • KingBubbaTruck

    KingBubbaTruck - 2009-01-07

    I'm not a C programmer, but I did manage to come up with some sort of a 'fix'. I have no idea what has changed, but it appears to have something to do with the way C handles 'Strings' Versus 'Character' data types. At any rate, I've got a wmr968, and by making 2 changes to the wmr918util.c file and recompiling, I was able to get wx200d to run.

    For whatever reason, Using sprintf to convert an int to an unsigned char has a length 1 more that what was previously expected.

    So, wmr918util.c -> wmr918parse
    Change the following lines. Basically, I just added 1 to the pressure and clock unsigned characters.

    //unsigned char pressure[4]; //coded abcd -> abcd
    unsigned char pressure[5]; //coded abcd -> abcd

    //unsigned char clock[2]; // used for hh, mm, ss conversion
    unsigned char clock[3]; // used for hh, mm, ss conversion

     
  • Nobody/Anonymous

    I think you found a bug. I'm a rusty C programmer, but I believe when sprintf is used it adds a null char to the end of the output array to make it a string. There may be other parts in the code that need this fix.

     

Log in to post a comment.

MongoDB Logo MongoDB