JorgeVelez / as3-arduino-connector

Automatically exported from code.google.com/p/as3-arduino-connector
0 stars 1 forks source link

Critical - memory corruption (buffer overrun ) #38

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run extensive communication
2. At some point, corrupted data will be received constantly.

What version of the product are you using? On what operating system?
1.5.0

Please provide any additional information below.

Up to 4095 bytes are read and edded to buffer.
If buffer already contains some data, there will be memory corruption.
At some point, mutex memory will be corrupted and library will output corrupted 
data.

Should be:

  while(1)
    {
      multiplatformSleep(10); 
      avail = 4096 - bufferSize;
      if ( avail > 0 )
        {
          incomingBufferSize = PollComport(comPort,incomingBuffer,avail);
              ...

Original issue reported on code.google.com by romanlut...@gmail.com on 11 Apr 2015 at 1:20

GoogleCodeExporter commented 8 years ago
p.s. Should be:
      avail = 4095 - bufferSize;
because there should be a space for trailing zero byte.

Original comment by romanlut...@gmail.com on 11 Apr 2015 at 1:24

GoogleCodeExporter commented 8 years ago
This project has been moved to GitHub by Google Code.  
https://github.com/quetwo/as3-arduino-connector  Would you mind submitting a 
pull request there to correct these issues?  I would love to include them in a 
new release.

Original comment by Nicholas...@gmail.com on 14 Apr 2015 at 10:01