MaikStohn / UP3D

UP 3D Printer Tools
GNU General Public License v2.0
80 stars 32 forks source link

Segmentation fault OSX when old firmware present #8

Closed kscheff closed 8 years ago

kscheff commented 8 years ago

For printer firmware <330 the program generates a segmentation fault. The issue seems might be caused of a additional pointer increment in up3dc.c:

    {
      uint8_t UP3D_CMD_2F_X[] = { 0x2F, b };
      memcpy( &send[0], UP3D_CMD_2F_X, 2 );
      memcpy( &send[2], data, 20*b );
  **    data++; //  should be removed **
      if( UP3DCOMM_Write( send, 2+20*b ) != 2+20*b )
        return false;
      blocks -= b;
      data += b;
    }
MaikStohn commented 8 years ago

Thanks for finding this bug and also correcting the other one (b>3) in your pull request.