-
Notifications
You must be signed in to change notification settings - Fork 17
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
Possible buffer overrun in ssd.c? #11
Comments
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. |
You are right. That doesn't seem correct. I think the intention is to get the barcode, without the 4 character for (i = 0; i < 12; i++) {
} I suppose it doesn't hurt to have scannerInput bigger. but scannerInput[12] is meant to be the eof character Tak On 11-11-20 10:42 AM, tmmagee wrote:
I.T. Manager |
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. |
The fix I just suggested was actually incorrect should have been for (i = 0; i< 13; i++) { and not < 12 because there are 13 characters altogether. If you have a check digit then your scanned input would have 14 Tak On 11-11-21 11:00 AM, tmmagee wrote:
I.T. Manager |
Your fix worked for us, Bottlecap. Thanks for the help. |
In ssd.c the scannerInput array is defined as follows:
But later in the code when the scanner input is read:
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?
The text was updated successfully, but these errors were encountered: