Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Possible buffer overrun in ssd.c? #11

Open
tmmagee opened this Issue · 5 comments

3 participants

@tmmagee

In ssd.c the scannerInput array is defined as follows:

 char scannerInput[12];

But later in the code when the scanner input is read:

  for (i = 0; i < 17; i++) {
       scannerInput[i] = serialBuffer[i+4];
   }

Is this buffer overrun intentional? I have seen this code in multiple is4c forks on github and it has not been corrected. I changed the size of scannerInput to 17 in my own code to correct the issue, and the daemon still appears to run fine. Is there something I am missing?

@maxolasersquad

That's a good find. I've ran through this code numerous times and never noticed it. I wonder if anyone else has any thoughts on this.

@Bottlecap
Owner
@tmmagee

I tried that fix and it did not work for me. Items did not scan correctly. I did not debug the issue, but I can only assume that by making the change you suggest the scanner was no longer scanning in the entire barcode.

Changing the size of the scannerInput to 17, however, did work just fine.

One note: the store I am working for (Mariposa Food Co-op) reads the check digit in UPC barcodes, so perhaps that was my problem for the fix you have just suggested.

@Bottlecap
Owner
@tmmagee

Your fix worked for us, Bottlecap. Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.