[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Possible off-by-one error
From: |
Andrea G. Monaco |
Subject: |
[PATCH] Possible off-by-one error |
Date: |
Wed, 03 Feb 2021 23:56:26 +0100 |
Hello,
I am still fairly new, so this could be wrong, but maybe I found an
off-by-one error.
diff --git a/i386/i386at/com.c b/i386/i386at/com.c
index 02b650b8..3402a025 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -101,7 +101,7 @@ comprobe_general(struct bus_device *dev, int noisy)
char *type = "8250";
int i;
- if ((unit < 0) || (unit > NCOM)) {
+ if ((unit < 0) || (unit >= NCOM)) {
printf("com %d out of range\n", unit);
return(0);
}
--
Andrea G. Monaco
Hacker, mathematician, lgbt+ activist
"Hope will never be silent!", H. Milk
- [PATCH] Possible off-by-one error,
Andrea G. Monaco <=